apparently same commits give different sha1, why?

前端 未结 1 1211
情话喂你
情话喂你 2020-12-16 15:42

After re-write of a subtree history from a repository with a script of mine, I compared it with what would do a git filter-branch ... on that same subtree. I se

相关标签:
1条回答
  • 2020-12-16 16:01

    Git's inputs to a commit hash include metadata such as the SHA1 of the tree, the SHA1 of the parent, the commiter's name, email and commit date, and the author's name, email and commit date. So when you rewrote history, the commiter commit date and the tree (since you did a filter-branch) have probably changed, hence the difference in your commit's SHA1.

    For more information about the format of a commit, you can use git cat-file commit <sha>, or look up the Git Objects section of the Git Book.

    0 讨论(0)
提交回复
热议问题