Git Aliases Temporarily ignore tracked files


To temporarily mark a file as ignored (pass file as parameter to alias) - type:

unwatch = update-index --assume-unchanged

To start tracking file again - type:

watch = update-index --no-assume-unchanged

To list all files that has been temporarily ignored - type:

unwatched = "!git ls-files -v | grep '^[[:lower:]]'"

To clear the unwatched list - type:

watchall = "!git unwatched | xargs -L 1 -I % sh -c 'git watch `echo % | cut -c 2-`'"

Example of using the aliases:

git unwatch my_file.txt
git watch my_file.txt
git unwatched
git watchall