Skip to content

Instantly share code, notes, and snippets.

@0187773933
Created June 6, 2022 23:13
Show Gist options
  • Save 0187773933/51745b04a58ea3c54f858332bdf55827 to your computer and use it in GitHub Desktop.
Save 0187773933/51745b04a58ea3c54f858332bdf55827 to your computer and use it in GitHub Desktop.
Fix git cloning of Gitea Large Repository Size
Cloning into 'LARGE REPOSITORY'...
remote: Enumerating objects: 20704, done.
remote: Counting objects: 100% (20704/20704), done.
remote: aborting due to possible repository corruption on the remote side.
fatal: early EOF
fatal: fetch-pack: invalid index-pack output
# enter bash of gitea docker container
sudo docker exec -it $TAG_ID bash
# cd into gitea repository location
cd /data/git/repositories/$GIT_USERNAME/$REPOSITORY_NAME.git
git config --global pack.windowMemory "100m"
git config --global pack.SizeLimit "100m"
git config --global pack.threads "1"
git config --global pack.window "0"
git gc
git repack -A --threads 1
# now you can clone on the limited memory raspberry pi
git clone --depth 1 "$REMOTE_GIT_URL" --config core.sshCommand="ssh -i /home/morphs/.ssh/private-gitea -o IdentitiesOnly=yes -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o ServerAliveInterval=60 -o LogLevel=ERROR -F /dev/null"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment