Skip to content

Instantly share code, notes, and snippets.

@rthbound
Created December 9, 2016 20:39
Show Gist options
  • Save rthbound/4b32075629c2fa67786b20a2cc989367 to your computer and use it in GitHub Desktop.
Save rthbound/4b32075629c2fa67786b20a2cc989367 to your computer and use it in GitHub Desktop.
git rebase --onto master develop feature/my-approved-feature
   Another example of --onto option is to rebase part of a branch. If we have the following situation:

                                   H---I---J topicB
                                  /
                         E---F---G  topicA
                        /
           A---B---C---D  master

   then the command

       git rebase --onto master topicA topicB

   would result in:

                        H'--I'--J'  topicB
                       /
                       | E---F---G  topicA
                       |/
           A---B---C---D  master

   This is useful when topicB does not depend on topicA.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment