Git · Senior · Question 63 of 76
What is the main reason Git can create branches in constant time?
- 1Git copies files lazily in the background
- 2Branches are virtual and stored only in memory
- ✓Correct answer: A branch is just a 41-byte file with a commit hash
Explanation
No files are copied; switching updates only files that differ between the two snapshots. This cheapness is what makes branch-heavy workflows practical.