Creating a Conflict
Goals
- Create a conflicting change in the master branch.
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.
当前内容版权归 gitimmersion 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 gitimmersion .