git update-index --assume-unchanged file.txt

Category: Git - Advanced

git update-index --assume-unchanged file.txt

Tell git to ignore changes to a tracked file locally

Tells Git to stop reporting changes to a tracked file — the file stays in the repo but local changes are ignored.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.