Midterm: Saving for the Winter

Just like homework, you will be submitting your answers as a zip folder on Autolab. Your zip folder should have the following structure:

    andrewid.zip/
        andrewid/
            midterm.txt
            midterm_q4
  

    Conceptual questions

    Please write your answers to each question in this section in midterm.txt.

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

    2. Give an example of a bad commit message. Do not copy the one in the notes.

    3. Give an example of a good commit message. Do not copy the one in the notes.

  1. Download the question 2 repository here. You will see that the repository contains a single commit that added three files, and that the working directory and staging area are clean (no changes to stage or commit). WITHOUT making a commit, use git commands (of course, you'll have to edit some of the files too) to change the git repository so that the output of git status looks like below. For your answer to this question, list all the commands you used in order.

  2. Aaron finished question 2 of this midterm, made a commit, then modified and staged fileB. The output of git status now looks like this:

    Give a git command for each of the following cases that will achieve Aaron's goal:

    1. He regrets staging his changes to fileB and wishes to undo it so that his changes to fileB are still in the working directory, but are not staged.
    2. He wishes to undo the changes to fileC that are in the working directory and restore it to the most recently committed version.
  3. Practical Committing and Merging

    You will answer the questions in this question by submitting the midterm_q4 git repository.

  4. Download the question 4 repository here. We will use git to manage writing a short story about a squirrel.
    1. Look through my_story.txt and the output of git log to familiarize yourself with the story. Don't forget to use the commands we've learned (git log, git show). You should be on the chapter-2-acorn-theft branch and there should be unstaged changes that add a chapter 2 to the story. Add and commit these changes and merge the chapter-2-acorn-theft branch into the master branch. You should be on the master branch with chapter 2 committed after you complete this step.
    2. Switch to the chapter-2-love-story branch and take a look at my_story.txt. On this branch, chapter 2 went in a different direction than on our original branch. Merge this branch into master to create a story that includes an acorn theft and a love story in Chapter 2. Make sure it has a happy ending! Feel free to be creative when resolving the merge conflicts. Don't forget to fully resolve all conflicts and finish the merge!