Quick Tip for Git Users: Touch .nil
Thursday
Sep 10, 2009
5:00 am
Users of Git will know that it refuses to story an empty directory. When one is trying to check in a generated project with a bunch of empty directories this can lead to confusion. It can also bite when you expect a directory to exist, but don't want to put it's contents under version control. ('/log' for example).
The way I have found to fix this is to touch <directory>/.nil This creates an empty hidden file in the directory that you can add to a git repository. It would be nice if there was a way to add empty trees, unless and until that happens this will save you a few minutes when you go to deploy and find you cannot open your log files.