Possible Duplicate:
git - removing a file from source control (but not from the source)
I have a .classpath
file which is currently in GIT repository.
After I pulled from remove repository(git pull origin master
). How can I remove this file from GIT control, I mean NOT to delete
this file from my computer but remove it from GIT version control. (Because this file is not needed for version control).
P.S.
I tried git rm <path-to>/.classpath
, but then my whole project complains about wrong class path, why git rm delete my file instead of remove from version control ???
Removing Files 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.
Use git rm --cached
to remove from the index but not the working tree.
After that, you should add .classpath
to your .gitignore file, to prevent it from being committed again.
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