Created
August 18, 2025 01:39
-
-
Save guizmaii/6762ff3aef0708d1e90672370bb54292 to your computer and use it in GitHub Desktop.
grbb
This file contains hidden or 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
# Usage: | |
# In a git-tracked directory, when on a branch A and you want to rebase it on branch B: | |
# | |
# $ grbb B | |
# | |
function grbb { | |
# shellcheck disable=SC2154 | |
local currentBranch | |
currentBranch=$(git branch --show-current) | |
git checkout "$1" | |
git pull | |
git checkout "${currentBranch}" | |
git pull | |
git rebase "$1" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment