Git Aliases Temporarily ignore tracked files

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

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


Got any Git Question?