Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I remove empty directories in git-svn?

Tags:

git

svn

git-svn

I have a specific problem I did not find a solution for, here or anywhere else. I have a Subversion repository and I am using git-svn to access it and work on it.

Some time ago, there were some empty directories in the Subversion repository (empty, only subfolders). Git does not track those. Then they were deleted from the Subversion repository. But I still have them even after running this command:

git svn rebase

And when I delete them by hand, they are recreated during the next command:

git svn rebase

How can I get rid of them?

I checked using pure Subversion and they are not in the repository.

like image 538
graywolf Avatar asked Jul 25 '13 18:07

graywolf


1 Answers

I think you'll find your answer in this blog post.

[...]

Remove directories from the SVN tree if there are no files left behind. SVN can version empty directories, and they are not removed by default if there are no files left in them. git cannot version empty directories. Enabling this flag will make the commit to SVN act like git. config key: svn.rmdir

To fix the root of the problem set the git config globally:

git config --global svn.rmdir true

[...]

like image 176
leifericf Avatar answered Sep 18 '22 22:09

leifericf