O'Reilly logo

Git Best Practices Guide by Eric Pidoux

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

Merging

A very nice process in Git allows you to combine the changes of two branches. This is called merging.

The git merge command performs a merge. You can merge changes from one branch to the current branch via the following command. Your local master branch is created as a tracking branch for the master branch of the origin repository:

Erik@local:~/webproject$ git checkout master
Erik@local:~/webproject$ git merge test

This command will merge test branch changes inside your current checked-out branch.

Fast forward merge

If the commits that are merged are direct predecessors of the HEAD pointer of the current branch, Git simplifies things by performing a so-called fast forward merge. This fast forward merge simply moves the HEAD pointer of the ...

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