LoginSignup
1
1

More than 5 years have passed since last update.

[Git] About Rebase

Last updated at Posted at 2014-10-21

git pull --rebase

This command will get rebase the remote branch with the local branch.

Before

        D --- E  local branch
       /
A --- B --- C  origin branch

After

              D --- E  local branch
             /
A --- B --- C  origin branch

git rebase --onto master server client

This will "Check out the client branch, figure out the patches from the common ancestor of the client and server branches, and then replay them onto master." (From here). That is to say:

The parts H, I, J will be picked up and add to the master branch.
Why pick up the H, I, J? Because the client and server have the same ancestor D, "from the common ancestor" that is to say from D.

Before

A --- B --- C  master 
       \
        D --- E --- F  server
         \
          H --- I --- J  client

After

              H --- I --- J  client
             /
A --- B --- C   master 
       \
        D --- E --- F  server
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1