Git · Senior · Question 2 of 76
Why does renaming a file not duplicate its content in Git's storage?
- 1Git stores renames as special rename objects
- ✓Correct answer: The blob is addressed by content; only the tree entry changes
- 3Renamed files are kept as diffs against the old name
Explanation
Identical content always has the same hash, so it's stored once. Renames are detected later by comparing trees, not recorded explicitly.