Git · Senior · Question 2 of 76

Why does renaming a file not duplicate its content in Git's storage?

Explanation

Identical content always has the same hash, so it's stored once. Renames are detected later by comparing trees, not recorded explicitly.

Further reading

Problem with a question

Git · Senior · question 2

Test yourself

Take the Git · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz