software engineering and random stuff blog

08 Nov 2019

Retrieve submodules with Git

Yesterday I had a really difficult time with pulling in a submodule from an old git repository I had laying around. I thought a quick Google DuckDuckGo search would solve all my problems, but alas. There was a lot of outdated information that simply didn’t work with the Git version I had installed on my computer (or I applied incorrectly).

Finally I found a answer on StackOverflow1 that put me in the right direction, but that also didn’t work. Eventually I gave up and did what I should have done in the first place: Look at the Git documentation for the submodule command2.

The command I ran (from the root of my git folder) that worked for me after I cloned my repository was:

git submodule update --init --recursive

Lesson learned: If there is documentation available, consult that first.

comments powered by Disqus