Git - Temporarily ignore trivial changes to files

前端 未结 4 1329
逝去的感伤
逝去的感伤 2021-01-29 22:22

I\'m looking for a way to \'hide\' minor changes made to a few files in Git, such that they will not show up in git status until a different change is made to those files.

4条回答
  •  感情败类
    2021-01-29 23:13

    In my use case (developing using an edited config file on my personal machine, running on another machine with the unchanged config), this was the solution for me:

    start ignoring changes to a file:

    git update-index --assume-unchanged path/to/file
    

    keep tracking again:

    git update-index --no-assume-unchanged path/to/file
    

提交回复
热议问题