There may be times when you want to edit some variables in for example a database connection file, to run an application right from within your GIT repo. Of course you don’t wont those changes to be commited, so you add the file the .gitignore.
However adding tracked files to .gitignore won’t work because GIT will still track the changes and commit the file if you use the -a parameter.
Fortunately GIT has a very easy solution for this, just run the following command on the file or path you want to ignore the changes of:
git update-index --assume-unchanged <file>
If you wanna start tracking changes again run the following command:
git update-index --no-assume-unchanged <file>
You can find more info about this in the git manual.
Happy GITting ;)
Pingback: Some git goodness « everyday
Pingback: Useful post on ignoring changes in a Git repository « Thoughts by Techxplorer
Pingback: Bits And Pix » Git: Cheat Sheet
Pingback: Note to Self » Blog Archive » Git ignore changes to tracked files
Pingback: GIT: Игнорирование изменений отслеживаемых файлов | T4G – Trailer for Gang
Pingback: Git Roundup #1 | Gradient Studios