Exercises
-
As we did at the start of this lab, clone the repository
camp-2-GITHUB_USERNAME
in the/tmp/USER/capp30121
directory 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
camp-2-GITHUB_USERNAME
repository. Edithello.py
in the home repository by changingWorld!
to your name:print("Hello, YOUR_NAME!")
Commit and push the new version of
hello.py
to the server. Pull the change to your temp repository. Now, in your temp repository, edithello.py
again 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 pull
just 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.py
once you have fixed the merge conflict. Hint:hello.py
should contain the following line at the end of this exercise:print("Hello, CAPP 30121!")
-
Use
git log
to find the commit SHA of the merge commit that you created to resolve the merge conflict from exercise 2. Usegit show
to view the changes in that commit. Pipe the output fromgit show
into a new file calledchanges.txt
. Commit the new file and push to GitHub.