git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Split a subversion repo into several git repos

From
ELEivind LM <eivliste@online.no>
Date
Oct 12, 2007, 14:14 UTC
Message-ID
<op.tz28hnd2jwclfx@ichi>
In-Reply-To
<470E9858.5050904@vilain.net>
On Thu, 11 Oct 2007 23:40:40 +0200, Sam Vilain <sam@vilain.net> wrote:
Show 34 quoted lines
> Jonathan del Strother wrote:
>>> For example, I want to convert one subversion repository which
>>> contains the folders:
>>> trunk/projectA
>>> trunk/projectB
>>>
>>> into two git repositories:
>>> projectA.git
>>> projectB.git
>>
>> I have a slightly different layout to you -
>>
>> projectA/trunk
>> projectA/branches
>> projectA/tags
>> projectB/trunk
>> projectB/branches
>> projectB/tags
>> etc
>>
>> - but I've been creating separate git repos from that with (for
>> example) :
>>
>> git-svn init -t tags -b branches -T trunk http://svn.host.com/projectA
>> git-svn fetch
>>
>>
>> Or will git-svn not work with your sort of layout?
>
> It does work.  Use:
>
> git-svn init -t projectA/tags -b projectA/branches \
>    -T trunk/projectA http://svn.host.com/
> git fetch
With my paths this translates into
   $ git-svn init -b eivindlm/branches \
                  -t eivindlm/tags \
                  -T eivindlm/trunk/src/probesimulator \
                  file:///svn-repo/
, which prints the happy message:
   Initialized empty Git repository in .git/
The next command is unfortunately not as happy:
   $ git fetch
   fatal: 'origin': unable to chdir or not a git archive
   fatal: The remote end hung up unexpectedly
   Cannot get the repository state from origin

I suppose this is due to my silly svn-repo layout... However, after some trial and error it seems like the following command gives me what I want (I don't need tags or other branches than main):

   $ git-svn clone file:///svn-repo/ --follow-parent \
                   -T eivindlm/trunk/src/probesimulator

It seems to realize that the probesimulator directory has moved around in my tree, and gives me history for files that belongs in this directory only (and not history for other directories). So the problem appears to be solved for my part, unless you see a reason for why I should not do it in this way.

> [...]
Thanks a lot for the help to everyone who replied!
Eivind
Previous: Sam VilainNext: Jonathan del Strother
Message 8 of 11 in “Split a subversion repo into several git repos”
  1. Eivind LMOct 11, 2007
  2. Patrick DoyleOct 11, 2007
  3. Eivind LMOct 12, 2007
  4. Jonathan del StrotherOct 11, 2007
  5. Patrick DoyleOct 11, 2007
  6. Karl HasselströmOct 11, 2007
  7. Sam VilainOct 11, 2007
  8. Eivind LMOct 12, 2007
  9. Jonathan del StrotherOct 12, 2007
  10. Eivind LMOct 12, 2007
  11. Sam VilainOct 12, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.