git update-index —assume unchanged

Thanks to this stackoverflow question, I’ve learned a useful git trick:

git update-index —assume-unchanged [ …]

and its counterpart:

git update-index —no-assume-unchanged [ …]

This pair of commands lets me keep a default file in the repo (e.g. a sample config) and modify it locally without git complaining about changed files. Handy!

Written by Tracy Poff on Mon 12 October 2015.