简体   繁体   中英

eclipse android gitignore for project.properties file

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM