Why You Shouldn't Use Git Submodules?

Git submodules may look powerful or cool upfront, but for all the reasons above it is a bad idea to share code using submodules, especially when the code changes frequently. It will be much worse when you have more and more developers working on the same repos.

Is using git submodules a good idea?

Its more accurate to say that git submodules are useful when you want to share code that you also need change along with the consumer of that code. ... There's additional complexity that comes along with using git submodules, and this complexity isn't worth it if there are simpler ways of sharing code.

Should git submodules be ignored?

No, you don't need to add your submodule to your . gitignore : what the parent will see from your submodule is a gitlink (a special entry, mode 160000 ). That means: any change directly made in a submodule needs to be followed by a commit in the parent directory.

James H. Sterling

James H. Sterling

Environmental Science & Climate Journalist

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.