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

后端 未结 9 1666
谎友^
谎友^ 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:47

    There is even a possibility to set the ignore mode for every added submodule within the .gitmodules file.

    Just today I encountered this problem and immediately wrote an article in my blog about it after finding a solution: How to ignore changes in git submodules

    The gist of it:

    Once you added a submodule there will be a file named .gitmodules in the root of your repository

    Just add one line to that .gitmodules file:

    [submodule "bundle/fugitive"]
        path = bundle/fugitive
        url = git://github.com/tpope/vim-fugitive.git
        ignore = dirty
    

提交回复
热议问题