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
*   69be050 2019-11-01 | Merge branch 'master' into greet (greet) [Jim Weirich]
|\  
* | 69a8d70 2019-11-01 | Updated Rakefile [Jim Weirich]
* | 7b8b268 2019-11-01 | Hello uses Greeter [Jim Weirich]
* | f84663f 2019-11-01 | Added greeter class [Jim Weirich]
| | * fabda38 2019-11-01 | Made interactive (HEAD -> master) [Jim Weirich]
| |/  
| * 099ccd0 2019-11-01 | Added README [Jim Weirich]
|/  
* ed35144 2019-11-01 | Added a Rakefile. [Jim Weirich]
* 4421854 2019-11-01 | Moved hello.rb to lib [Jim Weirich]
* 185fc95 2019-11-01 | Add an author/email comment [Jim Weirich]
* 4d578d4 2019-11-01 | Added a comment (tag: v1) [Jim Weirich]
* dc1d42f 2019-11-01 | Added a default value (tag: v1-beta) [Jim Weirich]
* 9a1c494 2019-11-01 | Using ARGV [Jim Weirich]
* 063b40e 2019-11-01 | 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.