So the other day when I was organizing my Dotfiles, I wanted to ignore some files with .gitignore
however since it was tracked, it was not ignoring the files. (I want to file exists in Remote but I don’t want to push changes because it contains sensetive data).
Found a neat way to do it:
- This command will manually ignore the changes:
git update-index --assume-unchanged <file>
- If you want to start tracking changes again:
git update-index --no-assume-unchanged <file>