git有日志压缩的概念吗?

Does git have a concept of log compaction?

git version control system, is a kind of distributed log (with some conceptual similarities to the raft 共识协议)。

Raft和其他一些系统有log compaction的概念,所以新客户端不需要遍历整个变更集来应用变更。

我的问题是:git有日志压缩的概念吗?

new clients don't need to traverse the whole change set to apply changes.

不,git 是快照的集合(工作树的完整副本)。
当您访问 git 中的提交时,您不必遍历所有日志或历史记录来构建其内容。

参见“How does git store files?": the internal storage does use delta in pack files(即 "compaction" 的形式,而不仅仅是 "log compaction"),但每次提交仍然代表完整的工作树。

Every time you commit, or save the state of your project in Git, it basically takes a picture of what all your files look like at that moment and stores a reference to that snapshot.
To be efficient, if files have not changed, Git doesn’t store the file again—just a link to the previous identical file it has already stored.