Midterm: Git Ready for Spring Break

You will be submitting your answers as text file on Autolab. You can download the answer template here.

    Conceptual Questions

  1. Is git distributed or centralized? Justify your answer by briefly explaining the difference.

  2. Explain why the file dino-story.txt appears in both the staging area and working directory in the image below.

    1. In the repository state shown below, which commit does HEAD~ refer to? (You can just give the short hash).
    2. Which commit does volcano~2 refer to?
  3. Practical Committing and Merging

    You will answer the questions in this question by creating and forking GitHub repositories. Please be sure to record their URLs in your midterm.txt so we can grade them!

  4. Create a new GitHub repository (click here for help) called branch-practice.
    SUPER IMPORTANT: Make the repository Public and do NOT initialize it with a README.
    Create a new repository on your computer (hint: git init) and set up your new GitHub repo as a remote called origin. Example: $ git remote add origin https://github.com/aperley/branch-practice.git.

    Now, use Git commands to replicate the repository structure shown below in your own repo. Make sure all three branches end up in the right spot.
    Push ALL THREE BRANCHES to your remote on GitHub. Your repo on GitHub will show all 6 commits and 3 branches if you get this right.

  5. Fork the dino-story-midterm repo (click here for help) and clone it to your computer. Complete the following steps:

    1. The dino story has been updated with Niko's chapter 2, which is intriguing but not very complete. Add one sentence to the beginning of chapter 2 to explain how Terry almost died. Commit this change on the master branch.
    2. Merge the volcano branch into master. In the merge commit message, state whether or not this merge caused conflicts and why.
    3. Merge the teresa-sucks branch into master. In the merge commit message, state whether or not this merge caused conflicts and why.
    4. Push the master branch to your fork on GitHub. Don't forget this!
    5. Extra Credit (not required): Create a pull request from the master branch you just pushed to the master branch on my repo (the one you forked from).