Reputation: 9434
I understand how blob sha1 is created , I understand what goes in for hash calculation for tag. Can anyone tell me or point me to the appropriate doc which explains commit object hash creation?
Upvotes: 1
Views: 216
Reputation: 9434
Okay I figured it out.
Following things go in creating commit sha object
I was trying to figure out why commit SHA ids are different after resetting and again adding the same file with exact same commit message by the same user with same parent and tree object reference .
Now I know its for timestamp. Wanted to share this.
Upvotes: 0
Reputation: 387
The bottom portion of this (Git Objects) page explains how the objects are generated and passed into the hashing function.
Basically, git takes the content of the item you are storing, generates a header with the length of the blob, combines them together (store = header + content
), and takes the SHA1 hash of store
.
Upvotes: 1