Update: I’m completely in love with Git these days. The issue I complain about here still hasn’t been changed, but it’s not that big of a deal if you’re aware of it ahead of time.
I’ve heard of Git before, and even looked into it a bit, but it wasn’t until atom recently returned form SXSWi that we decided to try and use it for ourselves. Apparently a bunch of respectable geeks there nearly cream themselves if you get them started on the subject.
I don’t know. There’s a lot of sweet-sounding features, but ultimately I ran into a deal-breaker that put me back into the hands of SVN/SVK.
Can I add empty directories?
Currently the design of the git index (staging area) only permits files to be listed, and nobody competent enough to make the change to allow empty directories has cared enough about this situation to remedy it.
Directories are added automatically when adding files inside them. That is, directories never have to be added to the repository, and are not tracked on their own.
You can say “git add <dir>” and it will add files in there.
If you really need a directory to exist in checkouts you should create a file in it. .gitignore works well for this purpose; you can leave it empty, or fill in the names of files you expect to show up in the directory.
via GitWiki
This is one of those things where I feel maybe I’m being stupid. Like there’s some l33t developer rule about not having empty directories in your application, and by mentioning something like this I’m exposing my inner noob self. Regardless, I still think this is rather ridiculous.
Atom found a comment somewhere that describes a workaround for this.
Git automatically ignores empty directories. If you want to have a log/ directory, but want to ignore all the files in it, first add log/* in .gitignore, then add an empty .gitignore in the empty directory.
No. No, thank you.
I’ll probably have to give it another try on a new project. Most of my rage comes from the fact that we were moving an existing project over to Git, but it used empty directories. It was very annoying and confusing for a minute there.