Maps to Git & GitHub Fundamentals -> Section 6: Tracking Changes (
git status,git add,git rm --cached,git diff,git log)
The thing that confuses every git beginner is the staging area - the middle
step between your files and a commit. Master it and git stops feeling like magic.
Work inside ~/sandbox/project (it already has one commit).
make start S=02-tracking-changes
# ...work in the container; when done, type 'exit' (or Ctrl+D) to leave, then:
make verify S=02-tracking-changes
make reset S=02-tracking-changes1.1 (graded) There's an untracked file a.txt. Stage it (add it to the
index) - but don't commit yet.
1.2 (graded) The file b.txt is already staged. Unstage it so it goes back
to untracked - without deleting the file from disk.
2.1 (graded) Edit tracked.txt (add a line). Then capture the difference
between your working copy and the last commit into ~/sandbox/changes.diff.
3.1 (graded) Save the repository's commit history to ~/sandbox/history.txt
(it should include the original initial commit).
- What's the difference between an untracked, a staged, and a committed file?
- How do you unstage a file without losing your changes?
git diffwith no arguments - what is it comparing?