Here is my answer from a similar question.
git update-index should do what you want
This will tell git you want to start ignoring the changes to the file
git update-index --assume-unchanged path/to/file
When you want to start keeping track again
git update-index --no-assume-unchanged path/to/file
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…