title: What is the best way to clone branches after cloning just trunk in git-svn?
body: <p>Given a large Subversion repository with many branches, I want to start using <code>git-svn</code> by cloning <code>trunk</code> first and adding specific branches later. I saw at least three ways to do this, but are any of them "official" or is there a best way?</p>
  
  <p>Assume the following layout:</p>
  
  <pre><code>https://svn-repo.com/svn/company
     +--core
     |  +--trunk
     |  +--branches
     |  |  +--fastboot
     |  |  +--playground
     |  +-tags
     +--mobile
        +--trunk
        +--branches
        +--tags
  </code></pre>
  
  <p>So, to clone only the trunk (no branches) revision 12345 of project <code>core</code>:</p>
  
  <pre><code>$ git svn clone --username=svnuser -r 12345 -Ttrunk https://svn-repo.com/svn/company/core
  </code></pre>
  
  <p>This will clone project <code>core</code> into a directory of the same name and running <code>git svn rebase</code> will pull in all the changes (after revision 12345). At this point <code>.git/config</code> should have something like this in it:</p>
  
  <pre><code>[svn-remote "svn"]
    url = https://svn-repo.com/svn/company
    fetch = core/trunk:refs/remotes/trunk
  </code></pre>
  
  <p>So far so good. Now, let's say I want to add the <code>playground</code> branch. This is where it gets a bit hazy.</p>
  
  <hr>
  
  <p><strong>Option 1</strong>: Update the existing remote in <code>.git/config</code> by adding the branch there:</p>
  
  <pre><code>[svn-remote "svn"]
    url = https://svn-repo.com/svn/company
    fetch = core/trunk:refs/remotes/trunk
    branches = core/branches/{playground}:refs/remotes/branches/*
  </code></pre>
  
  <p>At this point, I was able to do:</p>
  
  <ol>
  <li><p>Pull in revision 23456 of branch <code>playground</code></p>
  
  <p><code>$ git svn fetch -r 23456</code></p></li>
  <li><p>Create a local branch and switch to it</p>
  
  <p><code>$ git checkout -b playground branches/playground</code></p></li>
  <li><p>Pull in the latest changes:</p>
  
  <p><code>$ git svn rebase</code></p></li>
  </ol>
  
  <hr>
  
  <p><strong>Option 2</strong>: Add a new remote in <code>.git/config</code> (in addition to the existing one):</p>
  
  <pre><code>[svn-remote "playground"]
    url = https://svn-repo.com/svn/company
    fetch = core/branches/playground:refs/remotes/playground
  </code></pre>
  
  <p>From here, the steps are similar to the ones from <strong>Option 1</strong>:</p>
  
  <pre><code>$ git svn fetch playground -r 23456
  $ git checkout -b playground remotes/playground
  $ git svn rebase
  </code></pre>
  
  <hr>
  
  <p><strong>Option 3</strong>: I've also seen someone add a new fetch in the existing remote:</p>
  
  <pre><code>[svn-remote "svn"]
    url = https://svn-repo.com/svn/company
    fetch = core/trunk:refs/remotes/trunk
    fetch = core/branches/playground:refs/remotes/branches/playground
  </code></pre>
  
  <p>I'm not completely certain if that's correct or if it will even work. I can't find where I saw that.</p>
  
  <hr>
  
  <p>Currently, I'm sticking with <strong>Option 1</strong>, but I would really like to know the most appropriate way to do this.</p>