【发布时间】:2012-05-11 01:00:02
【问题描述】:
根据this:
请务必注意,这与大多数 SCM 非常不同 您可能熟悉的系统。颠覆,CVS,Perforce, Mercurial 等都使用 Delta Storage 系统 - 他们存储 一次提交和下一次提交之间的差异。 Git 不做 这 - 它存储项目中所有文件的快照 每次提交时看起来像这个树结构。这是一个 使用 Git 时要理解的非常重要的概念。
然而当我运行git show $SHA1ofCommitObject...
commit 4405aa474fff8247607d0bf599e054173da84113
Author: Joe Smoe <joe.smoe@example.com>
Date: Tue May 1 08:48:21 2012 -0500
First commit
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..de8b69b
--- /dev/null
+++ b/index.html
@@ -0,0 +1 @@
+<h1>Hello World!</h1>
diff --git a/interests/chess.html b/interests/chess.html
new file mode 100644
index 0000000..e5be7dd
--- /dev/null
+++ b/interests/chess.html
@@ -0,0 +1 @@
+Did you see on Slashdot that King's Gambit accepted is solved! <a href="http://game
... 它输出提交与先前提交的差异。我知道 git 不会将差异存储在 blob 对象中,但它是否将差异存储在提交对象中?还是git show 动态计算差异?
【问题讨论】:
-
附注:Git 实际上对对象进行增量压缩,但这只是为了压缩。人们有时会将此误解为 Git 存储差异。这里有一些格式的文档:book.git-scm.com/7_the_packfile.html(请记住,它记录的增量之间的对象只是它发现的相似数据块;它们不一定是同一文件的连续版本,尽管它们可能是。当然,增量不是逐行差异。)
-
从 Jefromi 更新非常相关的链接:git-scm.com/book/en/Git-Internals-Packfiles