1

I've got a SVN repository that looks something like:

\project1
 - branches
 - tags
 - trunk
\project2
 - branches
 - tags
 - trunk
\subfolder
  \project3
    - branches
    - tags
    - trunk
   \another-subfolder
     \project4
       - branches
       - tags
       - trunk
etc

There's probably 100 projects or so in here. I'd like to create git-svn repos for each of these, preferably one that mirrors the structure of SVN.

My initial thought was to write a script that walk the SVN tree and do a git svn -d clone for each project, but I'm wondering if there's a better way to do this (or if someone's built a tool so I don't have to do it myself). Is this reasonable, or are there better ways to perform this task?

matthewsteele
  • 1,797
  • 1
  • 15
  • 31
  • possible duplicate of [Split large Git repository into many smaller ones](http://stackoverflow.com/questions/3910412/split-large-git-repository-into-many-smaller-ones) – D'Arcy Rittich Dec 22 '11 at 16:23

1 Answers1

0

I wouldn't consider Split large Git repository into many smaller ones as a duplicate of this question, especially if you want to maintain the link between svn and your git repos, and be able to 'git svn dcommit' back to the SVN repo.

You can use some tools like svn2git or svneverever, a Python tool which will help you detect all the right project directories in order to write a svn2git rules file for those.

The other approach is illustrated by this article (for multiple branches, but can be applied to multiple projects as well): "Git-SVN? No, Git+SVN".
Ie checkout the right part of your svn repo and initialize a git repo in it.
See also "Clone multiple SVN projects with git-svn" for an example of this approach .

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250