Re:Note the commit hash
by bri3d on Sunday April 06, 2014 @06:25PM
(#7543403)
Not random.
A Git commit is one kind of "object" in git. Objects in Git are hashed like so:
SHA1("[objecttype] [objectlen]\0[objectdata]")
and a commit object looks like this (blatantly stolen from the Stripe V3 CTF):
tree #{tree}
parent #{parent}
author CTF user <[email protected]> #{timestamp} +0000
committer CTF user <[email protected]> #{timestamp} +0000
Give me a Gitcoin
The "tree" in the commit is the hash tree reference that actually points to your code.
A Git commit is one kind of "object" in git. Objects in Git are hashed like so:
SHA1("[objecttype] [objectlen]\0[objectdata]")
and a commit object looks like this (blatantly stolen from the Stripe V3 CTF):
The "tree" in the commit is the hash tree reference that actually points to your code.