Created
June 15, 2011 14:28
-
-
Save grafikchaos/1027225 to your computer and use it in GitHub Desktop.
Ignore uncommitted changes in tracked files with Git
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# == IGNORE LOCAL CHANGES | |
# ignore local changes to repository files or directories | |
git update-index --assume-unchanged path/to/file/or/directory | |
# -- ALIAS | |
# or you can alias it in your ~/.gitconfig | |
[alias] | |
au = update-index --assume-unchanged | |
# == UN-IGNORE LOCAL CHANGES | |
# update the index and removes the assume-unchanged flag so your changes | |
# can be committed | |
git update-index --no-assume-unchanged path/to/file/or/directory | |
# -- ALIAS | |
# or you can alias it in your ~/.gitconfig | |
[alias] | |
nau = update-index --no-assume-unchanged | |
# == LIST FILES/DIRS FLAGGED AS `assume-unchanged` | |
# list files/directories that have been marked as assume-unchanged | |
# lower-case `h` in first column tells us the file/directory has | |
# been marked as `assume-unchanged` | |
git ls-files -v [path/to/directory] | |
# -- ALIAS | |
# or alias it in your ~/.gitconfig | |
# this one passes the list to grep so we can filter on the lowercase letter | |
[alias] | |
ignored = !git ls-files -v | grep "^[[:lower:]]" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment