Reputation: 13143
I m collaborating with another developer over git. Our setup environments are different. To avoid adding the correct sdk and other libraries I decided to include this line in .gitignore
#eclipse
project.properties
but in the initial commits my project.properties file was pushed onto the repository. I thought updating the .gitignore file would take care of this problem on the other developers machine. But every time he pull the repository he has to update the project with the path of his sdk and library to be able to run the code.
Upvotes: 0
Views: 1598
Reputation: 1118
If you want to ignore a file within your git repository that was already tracked by the system, you have to delete the file from the repository cache. After deleting the file, you can add the ignore rule to your .gitignore file and it will be ignored by the repository.
First: Delete the file from the repository cache
git rm --cached path/file Second: Add the ignore rule to your .gitignore file
path/filename Third: Commit the updated .gitignore file
git add file git commit -m "Updated .gitignore rule" git push
found here:
http://www.wegtam.net/article/add-file-gitignore-was-already-tracked
Upvotes: 1