lab 26 Creating a Conflict
Goals
- Create a conflicting change in the main branch.
Switch back to main and create a conflict
Switch back to the main branch and make this change:
Execute:
git checkout main
lib/hello.py
print("What's your name?")
name = input().strip()
print(f"Hello, {name}!")
Execute:
git add lib/hello.py git commit -m "Made interactive"
View the Branches
Execute:
git hist --all
Output:
$ git hist --all * 33134b5 2023-08-21 | Merge branch 'main' into greet (greet) [Théophile Chevalier] |\ * | cc98109 2023-08-21 | Hello uses Greeter [Théophile Chevalier] * | d6aae18 2023-08-21 | Add greeter class [Théophile Chevalier] | | * b74b20e 2023-08-21 | Made interactive (HEAD -> main) [Théophile Chevalier] | |/ | * 6179ba3 2023-08-21 | Added README [Théophile Chevalier] |/ * 9ab61ca 2023-08-21 | Moved hello.py to lib [Théophile Chevalier] * 7abea37 2023-08-21 | Add an author/email comment [Théophile Chevalier] * 1c410c6 2023-08-21 | Add a comment (tag: v1) [Théophile Chevalier] * 0bf384c 2023-08-21 | Display user input (tag: v1-beta) [Théophile Chevalier] * 31c3945 2023-08-21 | Add some content [Théophile Chevalier] * aa5d425 2023-08-21 | First Commit [Théophile Chevalier]
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.