Skip to content

lab 29 Creating a Conflict

Goals

Switch back to master and create a conflict

Switch back to the master branch and make this change:

Execute:

git checkout master

lib/hello.rb

puts "What's your name"
my_name = gets.strip

puts "Hello, #{my_name}!"

Execute:

git add lib/hello.rb
git commit -m "Made interactive"

View the Branches

Execute:

git hist --all

Output:

$ git hist --all
*   a87176d 2020-06-20 | Merge branch 'master' into greet (greet) [Jim Weirich]
|\  
* | 228a31e 2020-06-20 | Updated Rakefile [Jim Weirich]
* | 98cfd8a 2020-06-20 | Hello uses Greeter [Jim Weirich]
* | cf0438b 2020-06-20 | Added greeter class [Jim Weirich]
| | * ee97f8e 2020-06-20 | Made interactive (HEAD -> master) [Jim Weirich]
| |/  
| * 8d90176 2020-06-20 | Added README [Jim Weirich]
|/  
* 5aec14d 2020-06-20 | Added a Rakefile. [Jim Weirich]
* 721b979 2020-06-20 | Moved hello.rb to lib [Jim Weirich]
* 907a445 2020-06-20 | Add an author/email comment [Jim Weirich]
* 4254c94 2020-06-20 | Added a comment (tag: v1) [Jim Weirich]
* c8b3af1 2020-06-20 | Added a default value (tag: v1-beta) [Jim Weirich]
* 30c2cd4 2020-06-20 | Using ARGV [Jim Weirich]
* 4445720 2020-06-20 | First Commit [Jim Weirich]

Master at commit “Added README” has been merged to the greet branch, but there is now an additional commit on master that has not been merged back to greet.

Up Next

The latest change in master conflicts with some existing changes in greet. Next we will resolve those changes.