Created
June 14, 2013 18:38
-
-
Save mulka/5784212 to your computer and use it in GitHub Desktop.
identical git commits having different hashes?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This doesn't make any sense to me. I thought two identical diffs would have identical commit ids in git. But, this does not appear to be the case, as I have made two commits which are otherwise the same. I did this by rebasing two branches off the same branch. I feel like the intermediate commits should have been the same, but then I saw a fork in my tree. See below: | |
(venv)Kyle-Mulkas-MacBook-Pro:tchat.io mulka$ git show 6d5aaae49d6 > 1 | |
(venv)Kyle-Mulkas-MacBook-Pro:tchat.io mulka$ git show 79a47534655 > 2 | |
(venv)Kyle-Mulkas-MacBook-Pro:tchat.io mulka$ diff 1 2 | |
1c1 | |
< commit 6d5aaae49d66d9cfa95c5340ef8562f876694758 | |
--- | |
> commit 79a47534655e4afbfebbcb354adeb59943ca7edc | |
(venv)Kyle-Mulkas-MacBook-Pro:tchat.io mulka$ |
Maybe this bears light? http://stackoverflow.com/questions/5144776/git-rebase-unexpected-mismatch-of-my-hashes
I do not know, but I'd assume it has to do with the commit time as part of the hash algorithm.
Or maybe not the date, but I think the hash is a bunch of stuff, not just the text content, like branch hierarchy, etc.
The date, and parent commit hashes are part of the hash of a particular commit
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Git rebase? I thought it changes the commit hash.