Sharan Basappa <sharan.basa...@gmail.com> writes: > I am pretty much new to Git though I am using it for a couple of projects > (without much understanding as such). > > In Git documents, it is mentioned that Git stores data as a stream of > snapshots. Compared to other VCS tools, the only difference I am able > to tell is that Git stores the entire file for each versions while > other VCS tools might store only differences. > > Can someone help me understand this?
Actually, you don't *need* to understand how it's done. You do need to understand that Git commands are organized around the idea that commits are a total copy of your project. OTOH, you need to be careful. Some commands, particularly ones involving merging and "rebase" actually *do* think of commits not as snapshots but as the difference between the commit and its parent. That is how you can "reorder" two commits -- changing the commit order from A - B - C is actually constructing new commits D and E so that in the new commit order A - D - E, the difference between A and D is the same as the difference between B and C, and the difference between D and E is the difference between A and B. But even in this situation, what is *stored* is a sequence of commits (done with sophisticated compression) -- the merge or rebase command calcuates the differences based on the contents of the old commits, and then constructs a new set of commits that have the proper differences between them, and then stores the new commits. Dale -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.