Skip to content

Instantly share code, notes, and snippets.

@tinabme
Last active July 13, 2016 13:08
Show Gist options
  • Save tinabme/9fa1a23fb958c9fc5b36d847bee237d8 to your computer and use it in GitHub Desktop.
Save tinabme/9fa1a23fb958c9fc5b36d847bee237d8 to your computer and use it in GitHub Desktop.
How to git ignore a single file that is already versioned

Ignore a single file that is already versioned

Sometimes you need to excluded a modified file from your git commit. There are a few ways to do this, my preference is this.

To ignore a single file that is already versioned:

git update-index --assume-unchanged "folder/folder/filename.foo"

Then you can complete your commit normally. sh (git commit -am "")

If you dont want to ignore file permanently, undo the ignore:

git update-index --no-assume-unchanged "folder/folder/filename.foo" 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment