Exercises
-
As we did at the start of this lab, clone the repository
git-ii-{GITHUB_USERNAME}in the/tmp/USER/capp30121directory that you have been working with throughout this lab. Be sure to use the SSH URL (beginning withgit@github.com:...) to clone this repository. -
Generate a merge conflict in the
git-ii-{GITHUB_USERNAME}repository. Edithello.pyin the home repository by changingWorld!to your name:print("Hello, YOUR_NAME!")Commit and push the new version of
hello.pyto the server. Pull the change to your temp repository. Now, in your temp repository, edithello.pyagain to changeYOUR_NAME!toCAPP 30121!:print("Hello, CAPP 30121!")Commit and push the changes to the GitHub server.
Switch back to your home repository. Do not run
git pulljust yet. Edithello.py, replacingCAPP 30121!withuniverse!. Attempt to add, commit, and push the change to the server. Did the attempt to push the commit work? Rungit pull.Oh no! Looks like we have another merge conflict. Using the steps that we followed in this lab, resolve the merge conflict, keeping the changes that you added from the temp repository. Be sure that both the home directory and the temp directory contain the same version of
hello.pyonce you have fixed the merge conflict. Hint:hello.pyshould contain the following line at the end of this exercise:print("Hello, CAPP 30121!") -
Use
git logto find the commit SHA of the merge commit that you created to resolve the merge conflict from exercise 2. Usegit showto view the changes in that commit. Pipe the output fromgit showinto a new file calledchanges.txt. Commit the new file and push to GitHub.