问题
I'm in the habit of making a git clone to a master location on my disk and then using a local git clone from there to cut down on download and copy times.
However, if I clone a project that has submodules, git clone --recursive, it will use --local for the main repo, but the submodule initialization is still by reference to URLS, which means I'm still going and doing a download again.
Is there a way to make git clone --recursive clone from the local copies of submodules instead of the canonical locations?
回答1:
this is my savior always:
git submodule update --init --recursive
This, initializes submodules and clones them even if you have submodules within submodules. I have an alias in my bash_profile for this and always use this for empty repositories and for simple update operations
alias gsu='git submodule update --init --recursive'
来源:https://stackoverflow.com/questions/30618109/how-can-i-get-git-clone-recursive-to-clone-submodules-locally