Skip to content

Instantly share code, notes, and snippets.

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 everdimension/590395dd20831f9a787101c4c3084085 to your computer and use it in GitHub Desktop.
Save everdimension/590395dd20831f9a787101c4c3084085 to your computer and use it in GitHub Desktop.
"git rebase --onto" — used to rebase only latest (or several latest) commits onto a new branch
# This is just a note to self
git rebase --onto <base-branch> <current-branch>~ <current-branch>
# e.g. git rebase --onto master feature/something~ feature/something
# it's important here to use branch name and not other commit id.
# Can't use "HEAD" instead of "feature/something" ¯\_(ツ)_/¯
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment