All How-Tos
Intermediate

How to Ignore Modified Files in Git

Learn how to ignore modified files that should not be committed.

Ignore Modified Files

If some of your tracked files have local modifications that you don't want to commit, you can either use "assume unchanged" or "skip worktree".

Use assume unchanged to temporarily ignore local changes to tracked files, assuming they haven't changed (even if they have), e.g. to speed up some Git operations or simply to hide them.

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

Use skip-worktree to ignore local changes to tracked files, but still allow Git to overwrite them during operations like checkout or merge.

git update-index --skip-worktree <file>
git update-index --no-skip-worktree <file>