Skip to content

Instantly share code, notes, and snippets.

@flyqie
flyqie / push.sh
Created November 26, 2022 04:54 — forked from Yash089610/push.sh
remote: fatal: pack exceeds maximum allowed size
# Adjust the following variables as necessary
REMOTE=origin
BRANCH=$(git rev-parse --abbrev-ref HEAD)
BATCH_SIZE=500
# check if the branch exists on the remote
if git show-ref --quiet --verify refs/remotes/$REMOTE/$BRANCH; then
# if so, only push the commits that are not on the remote already
range=$REMOTE/$BRANCH..HEAD
else