Created
November 18, 2010 17:10
-
-
Save mausch/705291 to your computer and use it in GitHub Desktop.
Shallow-cloned submodules in git
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Idea from http://stackoverflow.com/questions/2144406/git-shallow-submodules | |
git submodule init | |
for i in $(git submodule | sed -e 's/.* //'); do | |
spath=$(git config -f .gitmodules --get submodule.$i.path) | |
surl=$(git config -f .gitmodules --get submodule.$i.url) | |
git clone --depth 1 $surl $spath | |
done | |
git submodule update |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment