Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a project I want to clone:

$ git clone repo1 repo2

Everything copies over. Then I initiate submodules:

$ git submodule update --init --recursive

It downloads and populates the folders for all the submodules. I move into a directory of a submodule, and it's not a proper repo anymore.

I look closely at the submodule files and the .git folder has instead been turned into a file. This means I can't do development work on the submodules in the newly cloned project.

How do I get the clone to replicate the submodules, as git repos themselves, per the original project?

EDIT: May this have something to do with cloning from a relative path on the same machine? Perhaps an absolute path changes the manner of the clone?

This thread is exactly the same issue I'm having, but I just don't see the proposed solution as being the ideal answer: http://stackoverflow.com/questions/9459532/revert-to-pre-git-v1-7-8-git-submodule-behavior-with-submodule-filesystem-locati

share|improve this question

1 Answer 1

I've learned initiated submodules are headless. Fix:

$ git submodule foreach git checkout master

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.