Tell Git To Ignore Local Changes Made To A File

Add a file to ignore list [1] ↗️

Terminal window
git update-index --skip-worktree <file-list>

And to reverse it

Terminal window
git update-index --no-skip-worktree <file-list>

To list files ignored [2] ↗️

Terminal window
git ls-files -v . | grep ^S

This is useful if you want to make some changes to a file for a workaround that only happens in your local machine. This will tell Git to ignore these changes.