Reputation: 8412
In my rails project i use git to manage my code. I delete a branch with git like this :
git branch -D "my-branch-with-errors"
but files added with this removed branch still exists in my project. what's the problem here and how can i solve this issue. thank you
Upvotes: 3
Views: 226
Reputation: 16014
If you create new files in a Git repository but don't git commit
them, Git doesn't manage them. This means that changing branches, changing commits, or reverting changes does not affect those new files. You can either manually delete those new files, or run git clean
, which deletes unversioned files.
To delete the files you added, run
git clean -n
This will let you see which files Git will delete before your remove them so that you can be sure it won't affect any files you want to keep. Once you are sure that it will only affect files you want to get rid of, run
git clean -f -d
For more information, see this question.
Upvotes: 2