Skip to content

Instantly share code, notes, and snippets.

@iolloyd
Last active December 9, 2016 19:18
Show Gist options
  • Save iolloyd/15cb3a45871e4c11284971bf15f39728 to your computer and use it in GitHub Desktop.
Save iolloyd/15cb3a45871e4c11284971bf15f39728 to your computer and use it in GitHub Desktop.
Difference between cherrypick and rebase
   A---B---C---D master
  /
E---F---G---H feature

git rebase master feature

E---F---G---H feature
             \
              A'---B'---C'---D'

Note: A, B, C and D are no more

or

    A---B---C---D master
  /
E---F---G---H feature

git checkout master -b feature/new

git cherrypick A^..D

    A---B---C---D master
  /
E---F---G---H feature
              \
               A'---B'---C'---D' feature/new

Note: A, B, C and D are still there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment