Skip to content

Instantly share code, notes, and snippets.

@chabgood
Created April 29, 2022 16:47
Show Gist options
  • Save chabgood/699c992d2fa6ae73a4e790c5c58aa284 to your computer and use it in GitHub Desktop.
Save chabgood/699c992d2fa6ae73a4e790c5c58aa284 to your computer and use it in GitHub Desktop.
Bash git rebase
BRANCH=$(git rev-parse --abbrev-ref HEAD)
RELEASE=$(git branch -a | grep -Eo 'release/\d{2}.\d{2}.\d{2}' | tail -n 1)
git checkout ${RELEASE} && git pull
git checkout ${BRANCH} && git rebase ${RELEASE}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment