Search code examples
gitsvngit-svn

How to use git-svn when SVN repository really contains multiple "repositories"?


Supposed I have an umbrella SVN repo, "CompanyName". Within this repo, there are many projects, "Project1", "Project2", ..., "ProjectN". E.g. the SVN repo houses multiple projects instead of a single repo per project. I want to "move" Project1 to Git, so I tried to do this:

git svn clone --no-metadata --authors-file=users.txt --prefix=origin/ --trunk=Trunk --branches=Branches svn+ssh://me@svn.dev.companyname.biz/svn/CompanyName/Internal/Project1/

To which, git-svn responds:

Initialized empty Git repository in c:/Projects/CompanyName/Internal/Project1/.git/
Using higher level of URL: svn+ssh://me@svn.dev.companyname.biz/svn/CompanyName/Internal/Project1 => svn+ssh://me@svn.dev.companyname.biz/svn/CompanyName

Note that git has correctly moved up to the root of the repository, although I want it to focus on the path I specified. Moving into Project1, running git branch -r gives me no output, so this did not appear to work.


Solution

  • This was resolved by using the --no-minimize-url option to git svn:

    git svn clone --no-metadata --authors-file=users.txt --prefix=origin/ --trunk=Trunk --branches=Branches --no-minimize-url svn+ssh://me@svn.dev.companyname.biz/svn/CompanyName/Internal/Project1/