本文可理解为对官方文档的概括和自我理解
https://git-scm.com/book/zh/v1/Git-%E5%86%85%E9%83%A8%E5%8E%9F%E7%90%86-Git-%E5%AF%B9%E8%B1%A1
基于内容寻址
我们熟悉的windows系统是基于文件名的寻址系统。我们可根据文件进行定位和查找。而GIT,是将文件的内容计算得到一个hash值,而这个hash值是该内容的唯一索引。一个这种键值对就是一个blob对象
# 查看'test content'在git中的hash值
[wlin@wlin local_version]$ echo 'test content' | git hash-object --stdin
d670460b4b4aece5915caf5c68d12f560a9fe3e4
# 查看含有'test content'不同文件在git中hash值
[wlin@wlin local_version]$ echo 'test content' > file
[wlin@wlin local_version]$ git hash-object file
d670460b4b4aece5915caf5c68d12f560a9fe3e4
[wlin@wlin local_version]$ echo 'test content' > file_new
[wlin@wlin local_version]$ git hash-object file_new
d670460b4b4aece5915caf5c68d12f560a9fe3e4
# 以上可见,只要内容相同