Git: can I suppress listing of 'modified content'/dirty submodule entries in status, diff, etc?

后端 未结 9 1642
谎友^
谎友^ 2020-11-28 02:32

Somewhen (around the 1.6.x releases, I think) git became aware of changes inside submodules. That only serves to annoy me:

$ git status vendor | grep modified:
#          


        
9条回答
  •  無奈伤痛
    2020-11-28 02:51

    You can also use

    % git config [--global] submodule.ignore dirty
    

    to set submodule.ignore = dirty in your .git/config file. --global will set the ignore flag in your ~/.gitconfig and apply to all your repositories. Without it it should set in .git/config for just the repo you're in currently.

    The only documentation I can find on this is submodule..ignore at the git-config docs. I moved it from a .gitmodules file into my ~/.gitconfig and it's still working for me.

提交回复
热议问题