How to Ignore Modified Files in Git

Ignore Modified Files

Ignore Modified Files

If some of your tracked files have local modifications that you don’t want to commit, but rather let Git ignore them, 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 you simply want to hide.

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 their 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.

Try these Git operations with SmartGit's intuitive interface

Download SmartGit
Illustration of Smart Gitty, the SmartGit mascot -- a grey cartoon cat with glasses, sitting behind a laptop