Skip to content

Instantly share code, notes, and snippets.

@HackingGate
Last active March 31, 2022 09:57
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save HackingGate/bd5335b1f47e71b71f0134ae2fa7e7f2 to your computer and use it in GitHub Desktop.
Save HackingGate/bd5335b1f47e71b71f0134ae2fa7e7f2 to your computer and use it in GitHub Desktop.
git incremental clone
#####
alias pc4=proxychains4
#####
git_incremental_clone()
{
REPO=$1
DIR=$2
git clone --recurse-submodules $REPO $DIR --depth=1
cd $DIR
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
git fetch --depth=10
git fetch --depth=100
git fetch --depth=1000
git fetch --depth=10000
git fetch --depth=100000
git fetch --depth=1000000
git pull
}
pc4_git_incremental_clone()
{
REPO=$1
DIR=$2
pc4 git clone --recurse-submodules $REPO $DIR --depth=1
cd $DIR
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
pc4 git fetch --depth=10
pc4 git fetch --depth=100
pc4 git fetch --depth=1000
pc4 git fetch --depth=10000
pc4 git fetch --depth=100000
pc4 git fetch --depth=1000000
pc4 git pull
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment