I'm trying to understand how the git index file works.
I have a local repository with some files, one of them test.txt
. I was on commit X
and saved the index file of that commit to a temp directory.
Then I edited test.txt
added and committed it which created commit Y
. After that I ran git reset --hard X
and saved the index file of commit X
after having reset to it from commit Y
.
Then I compared both index files (from commit X
and from commit X
after having reset to it from commit Y
) and they were not identical. How can this be ? Is there a timestamp in the file ? as far as I know the index should have been reset to its previous contents (?)