Skip to content

Instantly share code, notes, and snippets.

@mausch
Created November 18, 2010 17:10
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mausch/705291 to your computer and use it in GitHub Desktop.
Save mausch/705291 to your computer and use it in GitHub Desktop.
Shallow-cloned submodules in git
#!/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