Skip to content

Instantly share code, notes, and snippets.

@Zodiase
Last active March 7, 2018 04:12
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 Zodiase/bcce9330831547e6a0005950014d7b34 to your computer and use it in GitHub Desktop.
Save Zodiase/bcce9330831547e6a0005950014d7b34 to your computer and use it in GitHub Desktop.
Download Git repo (clone without .git)
git-download() {
set -e
url="$1"
git_filename=$(basename "$url")
default_target=${git_filename%.git}
target=${2:-"$default_target"}
git clone --depth=1 "$url" "$target"
rm -rf "$target/.git"
set +e
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment