Possible Duplicates:
working with .git/info/exclude too late
.gitignore file not ignoring
git - removing a file from source control (but not from the source)
I have CVS/
in my both .gitignore
and my .git/info/exclude
files. But for some reason changes to any CVS folder are still tracked.
I'm tired of having to manually un-stage changes in these folders.
How do I make git stop tracking the CVS folders once it's decided to track them?
You can of course use git rm --cached , which removes it only from the index, leaving it untouched in the work-tree.
To remove a file from Git, you have to remove it from your tracked files (more accurately, remove it from your staging area) and then commit. The git rm command does that, and also removes the file from your working directory so you don't see it as an untracked file the next time around.
.gitignore
only causes git to ignore untracked files. "CVS" is already tracked so you must first remove it from the repository with:
git rm -r --cached CVS
The --cached
option causes git to leave the working copy of the file intact rather than removing it. Once done, the entry in .gitignore
will prevent git from interacting with the CVS directory again.
How do I make git stop tracking the CVS folders once it's decided to track them?
Git will never "decide" to track content, it does only what you tell it to. At some point you manually added it to the index and then committed it to the repository.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With