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?
.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.
精彩评论