O'Reilly logo

Git Essentials - Second Edition by Ferdinando Santacroce

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Rebasing branches

With the git rebase command you can also modify the story of branches; one of the things you do more often inside a repository is to change - or better to say - move the point where a branch started, bringing it to another point of the tree. This operation makes it possible to keep low the level of ramifications that would instead be generated using the command git merge, which we will see later.

In order to better understand this, let me give you an example.

Let's imagine that to the commit where the orange was added, a branch nuts was created in the past, to which a walnut was added.

At this point, let's imagine that we want to move this branch above, to the point where it is now master as if this branch had been created ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required