CS FundamentalsVery hardProduct-company placement · Git internals
How many of these statements about Git's object model are correct? 1. Two files with identical content in different folders are stored as a single blob. 2. A commit object records a tree, its parent commit(s), author, committer and message. 3. Renaming a file without changing its content creates a new blob. 4. A commit's hash depends on its parent's hash, so changing an old commit changes the hashes of all its descendants.
- A. 1
- B. 2
- C. 4
- D. 3
Correct answer: D. 3
Blobs are addressed by content alone, so identical files share one blob and a rename only changes the tree entry (3 is false). Statements 1, 2 and 4 are true; 4 is why history rewriting changes every later hash.
Practise more Software Engineering, Git and Cloud Basics questionsSoftware Engineering, Git and Cloud Basics: notes and key points
More Software Engineering, Git and Cloud Basics questions
- You pushed commit C to a shared branch, then ran git commit --amend to fix its message and tried git push again. What happens and why?
- main has A-B-X, where X was committed after feature branched from B; feature has C-D-E. How many commits are reachable from main after…
- In GitFlow, a critical bug is found in production (main) while develop holds unreleased work. What is the standard handling?
- A team practising trunk-based development wants to merge a half-built feature into main daily without exposing it to users. What makes…
- You have 2 local commits on main and the remote main has 3 new commits. What does git pull --rebase do?
- You staged changes to app.py with git add but now want them out of the next commit while keeping the edits in your working tree. Which…