Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I have not found any documentation about this feature, but looks like git svn configuration supports multiple fetch entries. This way you can also add branches separately without need to add another remote svn repository entry to your config nor using wildcards to get all branches of certain directory.</p> <p>Assume that your SVN tree is really nasty having lots of branches without any logic how they are located, e.g. having branches and sub-directories containing more branched.</p> <p>i.e. </p> <pre><code>trunk branches -&gt; branch1 -&gt; sub-dir1 -&gt; branch2 -&gt; branch3 -&gt; sub-dir2 -&gt; branch4 -&gt; sub-dir3 -&gt; branchX &lt;... hundreds more ...&gt; </code></pre> <p>and you just want to hand pick some of the branches to be included to your git repository.</p> <p>You may first init your repository with only trunk without any additional branches:</p> <pre><code>git svn clone -r 10000:HEAD https://svn.com/MyRepo myrepo --prefix=svn/ --trunk=trunk </code></pre> <p>After that you should see following configuration:</p> <pre><code>localhost: elhigu$ git config --get-regexp "svn-remote." svn-remote.svn.url https://svn.com/MyRepo svn-remote.svn.fetch trunk:refs/remotes/svn/trunk </code></pre> <p>when ever you want to fetch new branch from MyRepo you can just add new fetch entries to configuration by:</p> <pre><code>git config --add svn-remote.svn.fetch branches/sub-dir2/branch4:refs/remotes/svn/branches/sub-dir2/branch4 </code></pre> <p>Or you may edit the same configuration in .git/config</p> <p>To fetch the new branches after adding them to config just run:</p> <pre><code>git svn fetch -r 10000:HEAD </code></pre> <p><strong>[Edit]</strong> Sometimes it seems to be necessary to run fetch with --all parameter to fetch newly added branches:</p> <pre><code>git svn fetch --all -r 10000:HEAD </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload