Created
February 17, 2023 20:35
-
-
Save staticfloat/a578f9866bd2ea0649bd2e04093d3df2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Git rebase entire branch | |
grb() | |
{ | |
if git show-ref --verify --quiet refs/remotes/origin/main; then | |
BASE=${1:-origin/main} | |
else | |
BASE=${1:-origin/master} | |
fi | |
FIRST_COMMIT=$(git merge-base ${BASE} HEAD) | |
git rebase -i ${FIRST_COMMIT} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment