DEV Community

Cover image for 4 Git Submodules Alternatives You Should Know

4 Git Submodules Alternatives You Should Know

Eden Ella on August 26, 2019

Want to develop and share smaller modules between repositories? Here are some useful options. Sometimes you need to have code from one...
Collapse
 
olivierldff profile image
Olivier Le Doeuff

If working on c/c++ project and using cmake as a build script then the new FetchContent method work as a charm. Main feature is to handle 2 dependencies to the same project. This will only fetch once the required project and not twice like submodule would do.

Collapse
 
davebloom1 profile image
davebloom1

git submodules are simply horrible - great post!

Collapse
 
chexwarrior profile image
Andrew Lehman

Very useful, thanks for writing!

Collapse
 
jef profile image
Jef LeCompte

Never saw git subtree before. Could be a great solution. Thanks!

Collapse
 
cmcnicholas profile image
Craig McNicholas

We use submodules very effectively but you need a strict Dev team and a pipeline to perform the merge and very good separation of concerns.

Collapse
 
twisterrob profile image
Róbert Papp

Hey! Can you elaborate on this? Is there a blog post maybe already?

Collapse
 
jacobherrington profile image
Jacob Herrington (he/him)

Subtree is my preferred way of solving this issue!