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
*   19cb822 2020-05-30 | Merge branch 'master' into greet (greet) [Jim Weirich]
|\  
* | 4721c3f 2020-05-30 | Updated Rakefile [Jim Weirich]
* | 4689e1b 2020-05-30 | Hello uses Greeter [Jim Weirich]
* | e685fb0 2020-05-30 | Added greeter class [Jim Weirich]
| | * 6ec0242 2020-05-30 | Made interactive (HEAD -> master) [Jim Weirich]
| |/  
| * 32cb785 2020-05-30 | Added README [Jim Weirich]
|/  
* 128a484 2020-05-30 | Added a Rakefile. [Jim Weirich]
* a3cf03d 2020-05-30 | Moved hello.rb to lib [Jim Weirich]
* 96c1fec 2020-05-30 | Add an author/email comment [Jim Weirich]
* 9811d9e 2020-05-30 | Added a comment (tag: v1) [Jim Weirich]
* 3344f03 2020-05-30 | Added a default value (tag: v1-beta) [Jim Weirich]
* 3cb4c15 2020-05-30 | Using ARGV [Jim Weirich]
* dfb5614 2020-05-30 | 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.