Note that there are some explanatory texts on larger screens.

plurals
  1. POgit clone svn to split folders into separate git repositories
    text
    copied!<p>I have some old dump of a SVN repo with a straightforward structure:</p> <pre><code>trunk/src/ folder1/ folder2/ folder3/ ... </code></pre> <p>I know that each <code>folder</code> is in fact a separate project, so I would like to clone this svn repo into git but splitting each <code>folder</code> into separate git repository and preserving history. How can I do that?</p> <p>I don't need magic loop-scripts. I can name each folder manually. I would only like to know how to clone specific folder from svn into new git repository preserving history.</p> <p><strong>[Update]</strong></p> <p>I have only a dump of SVN repo, no SVN server. So I cant do</p> <p><code>git svn clone svn://path/to/my/trunk/src/folder1</code></p> <p>Instead I'm using</p> <p><code>git svn clone file://path/to/my/dump</code></p> <p><strong>[What I tried]</strong></p> <p>I've used <code>svnadmin</code> to create a svn dump file, then used <code>svndumpfilter</code> to filter out only folders that I need. I managed to split the original svn dump into separate files, one for each <code>folder</code>.</p> <pre><code>svnadmin dump /svn/old_repos &gt; ./repository.dump svndumpfilter include /trunk/scr/folder1 --drop-empty-revs --renumber-revs --preserve-revprops &lt; ./repository.dump &gt; ./folder1.dump </code></pre> <p>I tried to use <code>git svn clone file:///path/to/my/folder1.dump</code> but I got this error:</p> <pre><code>Couldn't open a repository: Unable to open an ra_local session to URL: Unable to open repository `file://path/to/my/filtered/dump/folder1.dump` at /usr/lib/git-core/git-svn line 2143 </code></pre> <p>This looks like the dump file is corrupted. I tried <code>svndump load /repos/folder1 &lt; /path/to/my/folder1.dump</code> but I got another error, this time from svnadmin:</p> <pre><code>svnadmin: File not found: transaction `0-0`, path `trunk/src/folder1 </code></pre> <p>Any ideas?</p>
 

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