Homework 2: Git on the Stage

Some questions will ask you to submit a file or folder. You should combine all of your files and folders into a zip folder named ANDREWID.zip and submit it on Autolab. Your zip folder should contain the hw2repo folder and the q2.txt text file.

  1. Clone the git repository located at YOUR_ANDREW_USERNAME@unix.andrew.cmu.edu:/afs/andrew.cmu.edu/course/98/174/public/hw2repo. Be sure to replace the YOUR_ANDREW_USERNAME part with your Andrew username. Git will ask you for your Andrew password, since it is retrieving it from the unix.andrew.cmu.edu machines.
    1. Make some modification to only file1.txt, then commit it, with a well written commit message.
    2. Make some modification to both file1.txt and file2.txt, then commit it, with a well written commit message.
    3. Create some file file3.txt, and commit it, with a well written commit message.
  2. In a file called q2.txt, answer the following questions on separate lines, then submit the file:
    • Give an example of a good commit message.
    • Give an example of a bad commit message.
    • Examine the following screenshot and note how fileA appears in both "Changes to be committed" and "Changes not staged for commit". This sounds like a contradiction (though it's not). Explain what happened and what commands were most likely entered to reproduce this screenshot. You may assume fileA and fileB are the only files in this repository. A contradictory git status output?

← Back to home