Support for migration of empty folders from SVN to Git

Is there any equivalent option in SubGit to preserve empty folders (many empty folders that are there for purpose ) while migrating SVN repo to git?
Something similar to “–preserve-empty-dirs --placeholder-filename=”.gitkeep" " in git svn clone


Hello Slava,

thank you for your interest in our products!

I’m afraid, though, that SubGit has no such options, SubGit handles the directories as they are, so if an empty SVN directory to be preserved in Git after migration, a stub file must be added in the directory.

Thanks a lot, Ildar, for your reply.
Does it mean I have to commit stub file to SVN before exporting the repository? And put it under each branch? while tags won’t have this structure any how…

Any plan to support for this feature in upcoming versions?


Hi Slava,

yes, that’s right, a stub file should be added in every empty SVN directory that should be preserved during the import, otherwise Git will not able to store this directory.
I’m afraid we don’t have any plans to add such a feature in upcoming versions.

Hi Ildar,

what is the process to order such feature? Whom shall I contact?


Hi Slava,

We have added this feature request to our roadmap:

I must note, however, that due to high load we got, this feature is considered minor and we have no time estimation for it,

it will be taken to work and implemented as soon as we have the less load.

The reason why the empty directories do not appear in Git is actually Git limitation, it just does not allow empty directories:

Git FAQ - Git SCM Wiki
and thus there is no other way to have such a directory in Git but to make it not empty adding some file in it.

So a possible workaround, as I mentioned in the support topic, is to add a stub file in those empty folders on SVN side;

if there are plenty of empty folder, then the best way would be to do this with a script to add all stub files automatically at once.

Another possible workaround, in case you don’t want to have those file in SVN, is to add the folders and files on the Git side after the migration

which can also be implemented with a script, yet this workaround can only be performed on one-time migrated and not mirrored repository.