public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Add .empty files to empty directories so git preserves them.
josh (author)
Mon Apr 21 17:09:46 -0700 2008
commit  6ccfc0ebdedb53794c4981521c4299d842caf896
tree    99f74faf76accb3426a55b4fab708508960e423d
parent  cf32baf915442ffe153ec0e4d8148f147776c30a

Comments

nigelramsay Wed Apr 23 21:40:45 -0700 2008

why not use .gitignore files instead?

josh Wed Apr 23 22:06:42 -0700 2008

git doesn’t track empty folders, we need to put a dummy file there so the tests pass.

augustl Thu Apr 24 00:41:11 -0700 2008

it’s common to put a empty .gitignore file in empty folders, think than was his point

pusewicz Thu Apr 24 05:18:54 -0700 2008

Yeah, just rename .empty to .gitignore, it’s a good practice.

trevorturk Thu Apr 24 06:58:44 -0700 2008

I heard using .gitignore was standard practice and have been doing it as well. It makes sense to me, because it lets you know the reason the files are there.

josh Thu Apr 24 07:12:01 -0700 2008

Gotcha!

nate Thu Apr 24 08:59:12 -0700 2008

to add .gitignore files to all empty directories recursively from your current directory find . \( -type d -empty \) -and \( -not -regex ./\.git.* \) -exec touch {}/.gitignore \;

andmej Tue Sep 09 21:04:01 -0700 2008

Nice trick, nate!