Search code examples
gitgit-submodulesgitignoregit-config

How to make git ignore changes to submodules by default


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

[submodule "actionbarsherlock"]
path = actionbarsherlock
url = git://github.com/JakeWharton/ActionBarSherlock.git
ignore = dirty

The important part here is ignore = dirty.

When using the git submodule add command, I'm forced to add this line by myself in the .gitmodules file.

How can I make this the default behavior for every git submodule add I'll make in the futur?

I know about the submodule.<name>.ignore configuration, but how to apply it to all by default?


Solution

  • So to close this, no, there is not default option for it (sadly).