How to make git ignore changes to submodules by default

后端 未结 5 1877
无人共我
无人共我 2021-01-05 12:11

Since gitmodules were introduced in Git, I like to add them like so:

[submodule \"actionbarsherlock\"]
path = actionbarsherlock
url = git://github.com/JakeWh         


        
5条回答
  •  误落风尘
    2021-01-05 12:50

    Today I found out that can use git config to change the .gitmodules file, and therefore can add the ignore dirty flag without going into the file and adding the line by hand:

    git config -f .gitmodules submodule.actionbarsherlock.ignore dirty
    

    In my case, I was able to automate the two steps in a script with that command.

提交回复
热议问题