Git · Junior · Question 12 of 75

Why doesn't Git track an empty directory?

Explanation

A tree object lists files and subtrees, so an empty folder has nothing to record. The usual workaround is a placeholder file such as .gitkeep.

Further reading

Problem with a question

Git · Junior · question 12

Test yourself

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

Take this quiz