As far as I know, Git's blob has SHA1 hash as file name. in order not to duplicate the file in the repository.
For example, if file A has a content of "abc" and has SHA1 hash as "12345", as long as the content doesn't change, the commits/branches can point to the same SHA1.
But, what would happen if file A is modified to "def" to have SHA hash "23456"? Does Git stores file A, and modified file A (not the difference only, but the whole file)?
- If so, why is that? Isn't it better to store the diff info?
- If not, how diff tracks the changes in a file?
- How about the other VCS systems - CVS/SVN/Perforce...?
ADDED
The following from 'Git Community Book' answers most of my answers.
It is important to note that this is very different from most SCM systems that you may be familiar with. Subversion, CVS, Perforce, Mercurial and the like all use Delta Storage systems - they store the differences between one commit and the next. Git does not do this - it stores a snapshot of what all the files in your project look like in this tree structure each time you commit. This is a very important concept to understand when using Git.