.gitkeep (Track Empty Directory)

20 Dec 2016   -   30 sec read

Git does not track empty directories. In order to track a directory, a file must exist within it. A trick that many people use is to create a hidden file usually called .gitkeep. The name of the file doesn’t matter. As long as there is a file in the directory .gitkeep, README.md etc, git will track it.

If you have a empty directory that you’d like to track, create a hidden file. eg. .gitkeep and commit it to the repository.






Share this: