guys, I just used submodule to organize some Git repos, here's the address: repos
I want to move all the submodule into a new directory called repos, for examples, jquery -> repos/jquery.
I change the .gitmodules file, but seems it doesn't work. What should I do?
Had the same problem just the moment ago and ended up deleting the submodule reference (as outlined in this article) and recreating it where i wanted it to go.
To follow your example of moving submodule jquery
into repos/jquery
.gitmodules
..git/config
for references to the submodule and remove them, if existentgit rm --cached jquery
to cut the submodule reference out of the repositorygit submodule add git://github.com/jquery/jquery.git repos/jquery
In case your submodule was set to specific tag, respectively commit (which you'll surely have in a stable project) you will have set it again.
Due to this complex process i am strongly hoping there is (or will be, at least on the git roadmap) a more straightforward way of achieving this. If not, surely some scripts could be fumbled together to do this quicker...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With