I have a GIT repository on a Linux machine where the HEAD commit's SHA1 is let's say 12345abcde
. This repository has several subfolders:
./
|-foo
| |-bar2
|-baz
When I clone this repository onto a Windows machine, I get the same history, but a different directory structure:
./
|-foo
| |-bar1
| |-bar2
|-baz
The SHA1 of the HEAD commit is the same value: 12345abcde
.
How is this possible? I was under the understanding that if the directory structure is different, the commit hash should be different.
bar1
used to exist at one point in history and it got deleted and renamed to bar2
. Therefore, the directory structure on the Linux machine is correct.
Has anyone else seen this? Does anyone know why this can occur? I have gone back through history and compared the commit hashes of every single commit on the Windows and Linux machines. They match.
How is this possible?
EDIT:
Version on Windows (MSYSGit) : 1.8.5.2
Version on Linux (Ubuntu 12.04): 1.7.9.5
EDIT2:
After updating the version on Linux to 2.0.0, re-creating the repository
and doing a clone to Windows, the directory trees and SHA1 hashes are consistent.
However, the SHA1 of HEAD on both Linux and Windows is now different - let's say
`67890defgh`
If somebody has any insight into why this happens, I'd be happy to accept the answer. The fundamental question here is how can different directory structures be created from the same list of commits with the same hashes?