我试着搜索git commit由什么组成,以及哪些部分参与了commit的sha哈希。但是,可能我在问错话,我什么都没发现。git commit integrity
我想知道什么提交包含。我读社区书了一下,有以下图片:
但是我认为犯有比图中显示更多的领域。
现在的主要问题是:哪些字段参与了commit sha hash?我在问,因为我在不同的仓库提交了两个具有相同散列哈希的提交,但具有不同的父提交。在此之前,我认为如果两个提交相同并且具有相同的父提交,则两个提交可能具有相同的哈希散列。所以我有点困惑。
我有两个本地存储库(git1,git2)一个是其他的克隆。
GIT1
commit 4f438f9579939312689eb67e5fb7957d87cfa036 <-- this commit
Author: Michael Nesterenko <[email protected]>
Date: Mon Jun 25 00:00:31 2012 +0300
stuff after change
commit e91e833158bb44f54f418cc5c3e1832452051428
Merge: dc69dc2 0b5912b
Author: Michael Nesterenko <[email protected]>
Date: Mon May 7 02:09:18 2012 +0300
Merge branch 'master' of e:/temp/git2
Conflicts:
file.file
commit 0b5912bd1a1cb9b78410fe5c0dc67845ca1deec5
Author: Michael Nesterenko <[email protected]>
Date: Mon May 7 02:06:46 2012 +0300
c8
commit dc69dc25a1e0c9067cbca19fe6a1d078a19138a0
Author: Michael Nesterenko <[email protected]>
Date: Mon May 7 02:06:29 2012 +0300
c7
commit f6d88da1ecc3106f6debe1eac80d4b02705bcecf
Merge: d1a3c38 6134e66
Author: Michael Nesterenko <[email protected]>
Date: Mon May 7 02:05:05 2012 +0300
Merge branch 'master' of e:/temp/git1
Conflicts:
file.file
commit d1a3c389416ff88e195e93def9a956fad1e63819
Author: Michael Nesterenko <[email protected]>
Date: Mon May 7 02:03:47 2012 +0300
GIT2
commit e1ee3b2756d4d8440ae3661df3fb3ec9af7cd55a
Merge: 4296e1b 4f438f9
Author: Michael Nesterenko <[email protected]>
Date: Mon Jun 25 00:01:30 2012 +0300
Merge branch 'master' of e:/temp/git1
Conflicts:
file.file
commit 4f438f9579939312689eb67e5fb7957d87cfa036 <-- this commit
Author: Michael Nesterenko <[email protected]>
Date: Mon Jun 25 00:00:31 2012 +0300
stuff after change
commit 4296e1bd046c4008166cfc516ef5ee2ce98a27d1
Author: Michael Nesterenko <[email protected]>
Date: Sun Jun 24 23:57:14 2012 +0300
more stuff
commit e91e833158bb44f54f418cc5c3e1832452051428
Merge: dc69dc2 0b5912b
Author: Michael Nesterenko <[email protected]>
Date: Mon May 7 02:09:18 2012 +0300
Merge branch 'master' of e:/temp/git2
Conflicts:
file.file
commit 0b5912bd1a1cb9b78410fe5c0dc67845ca1deec5
Author: Michael Nesterenko <[email protected]>
Date: Mon May 7 02:06:46 2012 +0300
c8
commit dc69dc25a1e0c9067cbca19fe6a1d078a19138a0
Author: Michael Nesterenko <[email protected]>
Date: Mon May 7 02:06:29 2012 +0300
,承诺有不同的父母,但相同的SHA哈希。
是什么让您认为提交在每个存储库中有不同的父项?请在每个存储库中显示'git cat-file commit 4f438f9579939312689eb67e5fb7957d87cfa036'的结果。另外,你运行什么日志命令来生成你发布的输出? –
@CharlesBailey,日志输出让我觉得如此。但出于某种原因,现在'git log'在两个存储库上显示'4f438f9579939312689eb67e5fb7957d87cfa036'的相同父提交。奇怪的!'git2'上的'git1'和'4296e1bd046c4008166cfc516ef5ee2ce98a27d1'上有'e91e833158bb44f54f418cc5c3e1832452051428'。 –
你提供什么选项来登录?如果你没有像'--graph'这样的东西,你不能看到实际的父关系,并会以合理的逻辑顺序看到你所要求的所有提交,但是你不能确定在另一个提交之前显示的提交是不管是直系后代还是非直系后代。 –