Skip to content

Instantly share code, notes, and snippets.

@just3ws
Created May 20, 2015 14:19
Show Gist options
  • Save just3ws/aff32026a53764c4487d to your computer and use it in GitHub Desktop.
Save just3ws/aff32026a53764c4487d to your computer and use it in GitHub Desktop.
Toggle a file from it's local changes being recognized by Git
git-assume-unchangeable () {
git update-index --assume-unchanged "$@"
}
git-assume-changeable () {
git update-index --no-assume-unchanged "$@"
}
git-show-unchangeable () {
git ls-files -v | grep -e "^[hsmrck]"
}
@just3ws
Copy link
Author

just3ws commented May 20, 2015

To ignore local changes

git-assume-unchangeable db/schema.rb

To resume recognizing local changes

git-assume-changeable db/schema.rb

To list the files marked as unchangeable

git-show-unchangeable db/schema.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment