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

后端 未结 9 1643
谎友^
谎友^ 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条回答
  •  -上瘾入骨i
    2020-11-28 02:33

    You may not want to add ignore = dirty to .gitmodules, you may want to be more selective about the changes you wished to ignore.

    To do that, add patterns to .git/submodule_foo/bar/info/exclude, where submodule_foo/bar/ is the path of the submodule.

    The patterns are similar to the patterns you would add to .gitignore, with the root being the submodule directory. For instance, this pattern ignores the build directory in the submodule submodule_foo/bar/:

    # in .git/submodule_foo/bar/info/exclude:
    /build/
    

提交回复
热议问题