When I run
git status git doesn't show the empty directory.
My remote repository is in github.
Can't I add and push empty directory?
The usual way to force adding an empty directory in systems that ignores empty directories is to add a hidden file in each such directory:
$ touch directoryname/.empty_dir $ git add directoryname/.empty_dir $ git push
git, you may choose to use
.gitignore in place of
.empty_dir above (really, any name will do, and the only reason to use a hidden filename is to avoid seeing it when you list the directory's contents with
You are not supposed to. But you can always add an empty
.gitignore to be able to do so.