Skip to content

Instantly share code, notes, and snippets.

@ifyouseewendy
Created December 16, 2014 03:50
Show Gist options
  • Select an option

  • Save ifyouseewendy/4e72bb0ec446899b784a to your computer and use it in GitHub Desktop.

Select an option

Save ifyouseewendy/4e72bb0ec446899b784a to your computer and use it in GitHub Desktop.
a git rebase demo from Pro Git

Now $git show-branch master server client shows like this:

<-- commit0 <-- commit1 <-- commit2                 master
                  \
                   \-- commit3 <-- commit4          server
                          \
                           \-- commit5 <-- commit6  client

What does $ git rebase --onto master server client do?

  1. Checkout client branch
  2. Figure out the patches from the common ancestor of server and client (commits of git log server..client)
  3. Replay the patches onto master

Run $git show-branch master server client again:

                            master                  client
                               |                       |
<-- commit0 <-- commit1 <-- commit2 <-- commit5 <-- commit6
                  \
                   \-- commit3 <-- commit4
                                      |
                                    server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment