Skip to content

lab 33 Creating a Conflict

Goals

Switch back to main and create a conflict

Switch back to the main branch and make this change:

Execute:

git checkout main

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
* 5e8ac5c 2022-10-24 | Add some suspicion (greet) [Jim Weirich]
* 71425e9 2022-10-24 | Add excitement (excitement) [Jim Weirich]
*   b1df40e 2022-10-24 | Merge branch 'main' into greet [Jim Weirich]
|\  
* | 18e7dbd 2022-10-24 | Updated Rakefile [Jim Weirich]
* | 2a024f1 2022-10-24 | Hello uses Greeter [Jim Weirich]
* | 85316c2 2022-10-24 | Added greeter class [Jim Weirich]
| | * 06325a5 2022-10-24 | Made interactive (HEAD -> main) [Jim Weirich]
| |/  
| * 62f7394 2022-10-24 | Added README [Jim Weirich]
|/  
* 0022837 2022-10-24 | Added a Rakefile. [Jim Weirich]
* 3172288 2022-10-24 | Moved hello.rb to lib [Jim Weirich]
* 3e56dbf 2022-10-24 | Add an author/email comment [Jim Weirich]
* 1dee7f9 2022-10-24 | Tell user how many names they have (tag: v1) [Jim Weirich]
* c72af6b 2022-10-24 | Rename variable to match its usage (tag: v1-beta) [Jim Weirich]
* 8cdd2cd 2022-10-24 | Can specify multiple names [Jim Weirich]
* 28fe396 2022-10-24 | Added a comment [Jim Weirich]
* 15c7573 2022-10-24 | Added a default value [Jim Weirich]
* 7d55044 2022-10-24 | Using ARGV [Jim Weirich]
* 91b926e 2022-10-24 | First Commit [Jim Weirich]

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

Up Next

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