Created
October 19, 2023 09:15
-
-
Save amaddio/e53cdccbe5c489d0d7f6dfced3d7f440 to your computer and use it in GitHub Desktop.
Rebase the (currently checked out) feature branch on top of the latest tip of the remote main branch
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
# git fetch: get the latest reference pointer of the remote | |
# --all: all branches | |
# --prune: delete local branches that were deleted on the remote | |
# git branch -vvv | grep main: show the offset of commits between local and remote's `main` branch | |
# git branch -vvv | grep $(git branch --show-current): show the offset of commits between local and remote's branch, that is checked-out. | |
# git rebase --autostash origin/main: rebase the (commits of the) current branch on top of the `main` branch | |
git fetch --all --prune && git branch -vvv | grep main && git branch -vvv | grep $(git branch --show-current) && git rebase --autostash origin/main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment