lab 35 Merging Back to Master

Goals

Merge greet into master 01

Execute:

git checkout master
git merge greet

Output:

$ git checkout master
Switched to branch 'master'
$
$ git merge greet
Updating 6fd9eff..b818028
Fast-forward
 Rakefile       | 2 +-
 lib/greeter.rb | 8 ++++++++
 lib/hello.rb   | 6 ++++--
 3 files changed, 13 insertions(+), 3 deletions(-)
 create mode 100644 lib/greeter.rb

Because the head of master is a direct ancestor of the head of the greet branch, git is able to do a fast-forward merge. When fast-forwarding, the branch pointer is simply moved forward to point to the same commit as the greeter branch.

There will never be conflicts in a fast-forward merge.

Review the logs 02

Execute:

git hist

Output:

$ git hist
* b818028 2014-10-25 | Updated Rakefile (HEAD, master, greet) [Jim Weirich]
* b790264 2014-10-25 | Hello uses Greeter [Jim Weirich]
* 0a576ce 2014-10-25 | Added greeter class [Jim Weirich]
* 6fd9eff 2014-10-25 | Added README [Jim Weirich]
* 14ba469 2014-10-25 | Added a Rakefile. [Jim Weirich]
* 4b249b3 2014-10-25 | Moved hello.rb to lib [Jim Weirich]
* bfd1408 2014-10-25 | Add an author/email comment [Jim Weirich]
* a1189df 2014-10-25 | Added a comment (tag: v1) [Jim Weirich]
* 6083cb8 2014-10-25 | Added a default value (tag: v1-beta) [Jim Weirich]
* b24f3ff 2014-10-25 | Using ARGV [Jim Weirich]
* cf466b4 2014-10-25 | First Commit [Jim Weirich]

The greet and master branches are now identical.

Table of Contents