Assessment --- Git Staging Area

Oct 2, 2014 • Dmitri Novikov
  1. If I type:
    <br /> $ git init<br /> $ echo hello world > hello.txt # creates hello.txt<br /> $ git add hello.txt<br /> $ echo hello universe >> hello.txt # appends to hello.txt<br /> $ git commit -m "Initial commit"<br />

What are the contents of hello.txt in HEAD?
a. hello world
hello universe
b. hello world
c. It’s an error because hello.txt contains conflicts that must be merged first
d. It’s an error becuase you need to run git add hello.txt again, because hell.txt was modified

  1. Imagine that I typed git diff instead of git commit on the last line of question 1. Then:

git diff hows the differences between Git’s ____ and my ____. git diff --staged shows the changes from the _____ to the _____. (The answers may be longer than 1 word).