How to have git-svn take care of empty directories gracefully?

I am very happily using git-svn, though I noticed that git has a different approach when it comes to empty directories as SVN. I need a way to get around the following particular situation:

I have in my project’s SVN repository several empty directories that belong in there and should not be touched. Due to some refactoring, I had to delete another directory that used to have files in it. git svn dcommit deletes the files, but leaves the directory. It strikes me that git’s ignorance of empty directories is resulting in inconsistency in my SVN repo.

  • How can I move all git content one-level up in the folder hierarchy?
  • A sane way to rename a directory in subversion working copy
  • Removing .svn files from all directories
  • Git: Renaming a directory in a branch
  • Git config with directory scope, containing multiple repositories
  • What's happened to my directory on GitHub?
  • I would like to have that particular directory removed from my SVN repository. Can git-svn do that? And if not, how should I be doing that? (And – eventually – how can I do that while committing other files with them as well in the same changeset?)

  • git - move branch “tag” to other commit?
  • Git alias with positional parameters
  • Git Tracking Upstream
  • made a disastrous mistake with “create git repo here” .how to rectify/undo?
  • Are git branches just tags?
  • Git says: More than one value for the key difftool.vs2012.cmd
  • 2 Solutions collect form web for “How to have git-svn take care of empty directories gracefully?”

    Use rmdir argument or config parameter:


    Only used with the dcommit, set-tree and commit-diff commands.

    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

    config key: svn.rmdir

    You will have to delete it on the SVN side:

    svn delete -m "deleting empty dir" http://path/to/deleted/dir
    Git Baby is a git and github fan, let's start git clone.