How to ignore changes in tracked files with Git

If you’ve added files into your GIT repository, then realised you don’t want changes to these files tracked.( ie. log files, cache directories etc. ) adding the tracked files to .gitignore won’t work.

GIT will still track the changes and commit the file if you use the -a parameter.

To untracked file changes use the below command:

git update-index --assume-unchanged <file>

If you wanna start tracking changes again run the following command:

git update-index --no-assume-unchanged <file>

For more info refer the Git manual on this topic

Justin Kelly

Justin Kelly

Data Engineeer, Business Analytics, Web Developer, Library Technology specialising in PHP and Tableau

Based in Melbourne, Australia

Feel free to contact me justin@kelly.org.au or _justin_kelly