I just started learning Git and to do so, I started reading the Git Community Book, and in this book they say that SVN and CVS store the difference between files and that Git stores a snapshot of all the files.
But I didn’t really get what they mean by snapshot. Does Git really make a copy of all the files in each commit? Because that’s what I understood from their explanation.
Git does include for each commit a full copy of all the files, except that, for the content already present in the Git repo, the snapshot will simply point to said content rather than duplicate it.
That also means that several files with the same content are stored only once.
So a snapshot is basically a commit, referring to the content of a directory structure.
Some good references are:
Lab 12 illustrates how to get previous snapshots
"You could have invented git (and maybe you already have!)"
What is a git “Snapshot”?
Learn GitHub
The progit book has the more comprehensive description of a snapshot:
See also:
.git/become huge over time?"Jan Hudec adds this important comment: