Skip to content

Instantly share code, notes, and snippets.

@Sacristan
Sacristan / push_commits_by_chunks.sh
Last active April 6, 2024 15:14
Push commits by chunks
REMOTE=origin
BRANCH=$(git rev-parse --abbrev-ref HEAD)
BATCH_SIZE=10
# 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
# # else push all the commits