Git 忽略已跟踪文件的改动

    忽略跟踪:

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

   

    恢复跟踪:

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

  

    查看已忽略的文件列表:

    You can use git ls-files -v. If the character printed is lower-case, the file is marked assume-unchanged.

git ls-files -v | grep '^[[:lower:]]'

    To embrace your lazy programmer, turn this into a git alias. Edit your .gitconfig file to add this snippet:

[alias]
    ignored = !git ls-files -v | grep "^[[:lower:]]"

 Now typing git ignored will give you output like this:

h path/to/ignored.file
h another/ignored.file

你可能感兴趣的:(git)