Skip to content

Instantly share code, notes, and snippets.

@WanLinLin
Last active April 25, 2024 03:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WanLinLin/982c37a376136acd1da2878ff322e9e6 to your computer and use it in GitHub Desktop.
Save WanLinLin/982c37a376136acd1da2878ff322e9e6 to your computer and use it in GitHub Desktop.
rebase.sh $target_branch $root_commit_hash
cur_branch=$(git branch --show-current)
git stash
git checkout $1
git pull
git checkout $cur_branch
git rebase --onto $1 $2
git stash pop stash@\{0\}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment