Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I untrack CVS folders after using git-cvsimport? [duplicate]

Tags:

git

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?

like image 799
dkinzer Avatar asked Nov 14 '10 17:11

dkinzer


People also ask

How do I permanently Untrack a file in git?

You can of course use git rm --cached , which removes it only from the index, leaving it untouched in the work-tree.

How do I remove a file from a track in git?

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.


1 Answers

.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.

like image 145
meagar Avatar answered Oct 17 '22 11:10

meagar