Alex Rivera | Logout

Git-svn W: -empty_dir warnings. What do they mean?

Asked 2010-11-10T17:44:03.680
38

While trying to clone an existing Subversion repository using git-svn using standard layout, I got a bunch of W: -empty_dir (and W: +empty_dir) warnings. The cloned git repository seems to be working, i.e. I can do usual git operations and dcommit to SVN repository.

The real problem is that the initial clone and rebase create some empty directories that do not exist in SVN repository, at the top of the repository (along with other directories in trunk). These directories contain no file but just some empty directories inside them. It seems that the "W: -empty_dir" warnings correspond to these empty directories.

I looked for empty directories by checking out the whole repository using SVN, but there is no empty directory. I also checked through SVN if the repository has files with special properties, but there was not any other than "executable" and "mime-type".

The existing repository was not originally following the standard layout, but I cleaned it up so that the top directories are just "trunk", "tags", and "branches".

What can be causing the creation of these empty directories that do not exist under Subversion?

Edit
Report

1 Answer

8

One of the things with git is that it does not track directories. It is all about content (files) in git. So empty directories are pretty much left to languish in your local repo. The best way to get rid of empty directories in your local repo is to do git clean -d.

Checkout man git clean for more info.

answered 2012-02-15T09:57:54.253

Your Answer