Lesson 1 · Unit 01
Snapshots, not diffs
A commit is the whole project plus a parent
What you practise
- A commit is a full snapshot plus a parent pointer, the history is a chain,
git log --oneline, whatgit showshows
Try a question from this lesson
Pick one
A project has 3 files. You commit, change one line in one file, and commit again. What does the second commit record?
Correct answer
A snapshot of all 3 files
Why
Every commit is a complete snapshot of the tracked files. It costs little: a file that did not change is not stored again, the new snapshot just points at the copy git already has.
The idea
Concept cards are short on purpose. In the app they appear between questions, after you have met the idea.
Concept
Snapshot plus parent
A commit holds a snapshot of every tracked file, the commit it came from (its parent), an author and a message.
Parents chain commits into a history. HEAD names the commit you are on, HEAD~1 is its parent and HEAD~2 is the one before that.
Git stores no diffs. When you ask for one, it compares two snapshots on the spot.
one <--- two <--- three
^
HEAD
each arrow means "my parent is"10 more exercises in the app
- 4× type the answer
- 2× multiple choice
- 1× true or false
- 1× fill the blanks
- 1× order the lines
- 1× match the pairs
Bitpath is an iOS app in development. Join the waitlist and you get one email when it is ready to try.