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>

With SmartGit

Select the file in SmartGit, then use Local | Toggle 'Assume Unchanged' or Local | Toggle 'Skip Worktree', respectively.

To unset this option again, you can type the file name into the File Filter input field and invoke the same Toggle menu item. Alternatively, you can make the file visible in the Working Tree or Log window by selecting View | Show Assume Unchanged Files or View | Show Skipped Files. In the Standard window use the combobox above the files view to show All files, incl. ignored.