Snapshots, Not Differences
Most version control systems store changes as a list of differences (what changed from version to version). Git does something different.
Other Systems: Differences
Version 1: Create file.txt Î Add line 5 Î Change line 2 Î Delete line 7
To see version 4, must replay all changes from the beginning.
Git: Snapshots
đ¸ Snapshot 1 đ¸ Snapshot 2 đ¸ Snapshot 3 đ¸ Snapshot 4
Each snapshot is a complete picture, instantly accessible.
âšī¸Why does this matter?
Snapshots are faster to access and more reliable. Git does not need to rebuild a version by replaying changes.
â ī¸Wait, does that waste space?
Good question. If every commit stored a complete copy of everything, your repository would grow huge. Git is clever about this - let us see how in the next section.