How to do git-svn fetch and retain empty directory?
<p>I have created a simple script to migrate fairly large SVN repository. Instead of using <code>git svn clone</code>, I am using <code>git svn init</code> and <code>git svn fetch</code> so that I could specify the revision and fetch it chunk by chunk. More or less, it is something like this:</p>

<pre><code>while [ "$CURRENT_REVISION" -lt "$MAX_REVISION" ]; do
  END_REVISION=$((CURRENT_REVISION + 100))
  if [ "$END_REVISION" -ge "$MAX_REVISION" ] 
  then
    END_REVISION=$MAX_REVISION
  fi

  git svn fetch -r "$CURRENT_REVISION":"$END_REVISION"  --authors-file="$AUTHORS_FILE" 

  #increasing the current and end revision
  CURRENT_REVISION=$END_REVISION
  END_REVISION=$((CURRENT_REVISION + 100))
done
</code></pre>

<p>However, I understand that by default the behavior of the fetch/clone will not retain empty directories. Thus, I might need to manually check in those empty directories (*which I'm trying to avoid). </p>

<p>There is a <code>--preserve-empty-dirs</code> parameter in the <code>git svn clone</code> but not in <code>git svn fetch</code>.</p>

<p>Is there any workaround to trick this out?</p>

<p><strong>UPDATE</strong></p>

<p>Even though it is not mentioned in the official documentation that we can use the config key for the fetch, it is actually works</p>

<p>There is detailed explanation by @Vampire related to this question. So I'll simplify this.</p>

<p>After doing the init repository, I had to change the configuration of my remote branch:</p>

<p><code>git config svn-remote.&lt;remote name&gt;.preserve-empty-dirs "true"</code></p>

<p><code>git config svn-remote.&lt;remote name&gt;.placeholder-filename ".gitkeep"</code></p>

<p>You can verify the configuration by looking at /.git/config. Just do normal fetch and your directory will be preserved.</p>