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
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
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.
Example: When your app does not have privileges to create new directories in the server it has been deployed.
I usually add a .gitkeep file in directories that must exists for my app to run properly (I avoid having to write code that checks their existence and their creation). For example, the directory that holds user avatars.
Sometimes, a empty folder need to to be kept for files generated when compiling.