git untrack file

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

  

原文地址:https://www.cnblogs.com/eleven24/p/7218175.html