35. Merging to the Master branch

Goals

  • We have kept our style greet branch up to date with the master branch (using rebase), but now let’s merge the style branch changes back into the master.

01 Merging style into master

Run:

git checkout master
git merge style

Result:

$ git checkout master
Switched to branch 'master'
$
$ git merge style
Updating 6c0f848..6e6c76a
Fast-forward
 index.html       |    2 +-
 lib/style.css |    8 ++++++++
 lib/hello.html   |    6 ++++--
 3 files changed, 13 insertions(+), 3 deletions(-)
 create mode 100644 lib/style.css

Since the last master commit directly precedes the last commit of the style branch, git can merge fast-forward by simply moving the branch pointer forward, pointing to the same commit as the style branch.

Conflicts do not arise in the fast-forward merge.

02 Check the logs

Run:

git hist

Result:

$ git hist
* 6e6c76a 2011-03-09 | Updated index.html (HEAD, master, style) [Marina Pushkova]
* 1436f13 2011-03-09 | Hello uses style.css [Marina Pushkova]
* 59da9a7 2011-03-09 | Added css stylesheet [Marina Pushkova]
* 6c0f848 2011-03-09 | Added README [Marina Pushkova]
* 8029c07 2011-03-09 | Added index.html. [Marina Pushkova]
* 567948a 2011-03-09 | Moved hello.html to lib [Marina Pushkova]
* 6a78635 2011-03-09 | Add an author/email comment [Marina Pushkova]
* fa3c141 2011-03-09 | Added HTML header (v1) [Marina Pushkova]
* 8c32287 2011-03-09 | Added standard HTML page tags (v1-beta) [Marina Pushkova]
* 43628f7 2011-03-09 | Added h1 tag [Marina Pushkova]
* 911e8c9 2011-03-09 | First Commit [Marina Pushkova]

Now style and master are identical.

SVN?
© 2011-2014 Git How To. All rights reserved / Contact us