Created
March 16, 2021 09:56
-
-
Save galsi/2c1ef0226dfa2d72dfff4faf858a1894 to your computer and use it in GitHub Desktop.
Quick Clone Git Repo
This file contains 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
clonepath=/<FILL> | |
branchtoclone=<FILL> | |
checkoutfolder=<FILL> | |
repourl=https://... | |
echo '*************Quick Clone*******************' | |
echo 'Dircetory : ' $clonepath | |
echo 'Branch : '$branchtoclone | |
echo 'CheckOut Folder : '$checkoutfolder | |
echo '*******************************************' | |
time git clone --depth 1 --branch $branchtoclone --single-branch --sparse $repourl $clonepath | |
cd $clonepath | |
time git sparse-checkout add $checkoutfolder | |
read -n1 -rsp $'Press any key to continue or Ctrl+C to exit...\n' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uses Git sparse-checkout feature