Skip to content

Instantly share code, notes, and snippets.

@fallaciousreasoning
Created January 12, 2024 00:49
Show Gist options
  • Save fallaciousreasoning/96fc495b1697f6c32f5d126c20fc29ce to your computer and use it in GitHub Desktop.
Save fallaciousreasoning/96fc495b1697f6c32f5d126c20fc29ce to your computer and use it in GitHub Desktop.
Generic script for continuing the current git operation
#!/usr/bin/env bash
repo_path=$(git rev-parse --git-dir)
if [ $? -ne 0 ]; then
exit $?
fi
if [ -d "${repo_path}/rebase-merge" ]; then
git rebase --continue
elif [ -d "${repo_path}/rebase-apply" ]; then
git rebase --continue
elif [ -f "${repo_path}/MERGE_HEAD" ]; then
git merge --continue
elif [ -f "${repo_path}/CHERRY_PICK_HEAD" ]; then
git cherry-pick --continue
elif [ -f "${repo_path}/REVERT_HEAD" ]; then
git revert --continue
else
echo "Nothing in progress?"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment