Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why would you track an empty directory with Git?

I've seen people adding .gitkeep, .keep files in empty directories on a Git repo and I just don't see why I would ever need to track en empty dir.

Can you mention some examples where that would be necessary?

Related

What are the differences between .gitignore and .gitkeep?

like image 423
pgpb.padilla Avatar asked Sep 02 '25 14:09

pgpb.padilla


1 Answers

When creating a template project for others to implement it may be convenient to include empty directories to help guide where certain content should go.

For example, an MVC template repo could include empty model, view, and controller folders that are already in the correct location and ready to be filled with files.

like image 150
Jonathan.Brink Avatar answered Sep 05 '25 12:09

Jonathan.Brink