Skip to content

Instantly share code, notes, and snippets.

@magnetikonline
Created October 21, 2014 22:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save magnetikonline/50e0e9a2b3837110ba0d to your computer and use it in GitHub Desktop.
Save magnetikonline/50e0e9a2b3837110ba0d to your computer and use it in GitHub Desktop.
Git shallow clone repository and any sub-modules within.
#!/bin/bash
git clone --depth 1 \
-qb $BRANCH_NAME \
$REPOSITORY_URL $TARGET_CLONE_DIR
cd $TARGET_CLONE_DIR
git submodule update -q --init --depth 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment