What is the long hexadecimal code that names a Git commit?
An object ID computed with the repository's hash algorithm.
- A random serial number
- A hash-based object ID ✔
- The date and time in hexadecimal
Why: Git names stored objects with a cryptographic hash. Traditional repositories use 40 hexadecimal SHA-1 digits, while SHA-256 repositories use 64, so the identifier depends on the repository's object format.
Huh, didn't know that: Git accepts an abbreviated object ID only when the prefix is long enough to be unique in that repository.
My commit hash is so long, I need a commit to remember it.
References
Answer: A hash-based object ID. Git names stored objects with a cryptographic hash. Traditional repositories use 40 hexadecimal SHA-1 digits, while SHA-256 repositories use 64, so the identifier depends on the repository's object format.
- Pro Git book: What is Git? git-scm.com/book/en/v2/Getting-Started-What-is-Git%3F
This is a 40-character string composed of hexadecimal characters
Checked 2026-10-10. - Git hash function transition git-scm.com/docs/hash-function-transition
Objects can be named by their 40 hexadecimal digit SHA-1 name or 64 hexadecimal digit SHA-256 name
Checked 2026-10-10.
Think this answer is wrong? Tap "Challenge this answer" on the card in the game and tell us why.
More stuff everyone should know
That's stuff everyone should know.