Last active
January 30, 2023 20:34
-
-
Save jason-witter/1009bdb75b415893f6be0c291ae76ebc to your computer and use it in GitHub Desktop.
Rebase git command (primary branch agnostic)
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
function gr | |
set -l primary_branch (git symbolic-ref refs/remotes/origin/HEAD | sed 's+refs/remotes/origin/++') | |
git fetch | |
git add . | |
git commit -m "stuff" | |
git rebase -i "origin/$primary_branch" | |
git push -f | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment