Recall & Review
beginner
What is SHA-1 in the context of Git?
SHA-1 is a cryptographic hash function that Git uses to uniquely identify commits, files, and other objects by generating a 40-character hexadecimal string.
Click to reveal answer
beginner
Why does Git use SHA-1 hashes for its objects?
Git uses SHA-1 hashes to ensure data integrity and to quickly check if content has changed by comparing unique hash values instead of the full content.
Click to reveal answer
beginner
How long is a SHA-1 hash string in Git?
A SHA-1 hash string in Git is 40 characters long, consisting of hexadecimal digits (0-9 and a-f).
Click to reveal answer
intermediate
What happens if two different files produce the same SHA-1 hash in Git?
This is called a collision and is extremely rare. Git relies on SHA-1's uniqueness to avoid collisions, ensuring each object is uniquely identified.
Click to reveal answer
beginner
How can you see the SHA-1 hash of the latest commit in a Git repository?
You can run the command git log -1 --format=%H to display the full SHA-1 hash of the latest commit.
Click to reveal answer
What does a SHA-1 hash represent in Git?
✗ Incorrect
SHA-1 hashes uniquely identify Git objects like commits and files.
How many characters long is a SHA-1 hash string in Git?
✗ Incorrect
SHA-1 hashes are 40 hexadecimal characters long.
Which Git command shows the SHA-1 hash of the latest commit?
✗ Incorrect
The command 'git log -1 --format=%H' outputs the full SHA-1 hash of the latest commit.
Why is SHA-1 hashing important in Git?
✗ Incorrect
SHA-1 hashes help Git uniquely identify objects and verify their integrity.
What is a collision in SHA-1 hashing?
✗ Incorrect
A collision happens if two different inputs generate the same SHA-1 hash, which is very rare.
Explain what SHA-1 hashing is and why Git uses it.
Think about how Git tracks changes and verifies data.
You got /4 concepts.
Describe how you can find the SHA-1 hash of a commit in Git and what it represents.
Focus on commands and the purpose of the hash.
You got /3 concepts.