Git uses SHA-1 hashes for its objects. Why is this important for Git's operation?
Think about how Git identifies files and commits uniquely.
Git uses SHA-1 hashes to create a unique fingerprint for each object based on its content. This helps Git detect changes and avoid duplicates.
Given a Git object hash, what output does the command git cat-file -p <hash> produce?
git cat-file -p e69de29bb2d1d6434b8b29ae775ad8c2e48c5391Consider what 'cat-file' means in Git.
The command git cat-file -p <hash> prints the content of the Git object, such as a commit, tree, or blob.
Git stores changes using a special mechanism to save space. Which workflow best describes this mechanism?
Think about how Git optimizes storage for many versions of files.
Git uses packfiles that store objects efficiently by saving deltas (differences) between similar objects, reducing disk usage.
Running git fsck shows 'dangling commit' messages. What does this mean?
Consider what it means for a commit to be 'dangling' in Git.
Dangling commits exist but are not referenced by any branch or tag, often from rebases or resets.
When facing complex merge conflicts, why does knowing Git internals help?
Think about how Git tracks changes and conflicts internally.
Understanding Git internals helps you grasp how changes are stored and merged, making conflict resolution more effective and allowing use of advanced features.