Search code examples
gitsvngit-svn

SVN to GIT - Multibranch repository


I am converting an SVN repository to a brand new GIT repository.

The old SVN repo has multiple branches:enter image description here

I did manage to do a conversion, using the svn2git tool.

git svn clone https://url/to/svn/server --no-metadata --authors-file=authors-transform.txt

Although, the file history conversion was not successful. On the new GIT repository, I can only see the file history for the determinate folder, not trough all old "svn branches".

How can I migrate those svn folders (branches) to a GIT structure, so that file history can be successful maintained?

Perhaps, make every svn folder a new GIT branch, and keep the latest svn branch as the master branch on the new GIT repo.


Solution

  • Re-read git svn docs, add all required parameters in order to define location(s) of your repo's branches/tags/

    Even if https://url/to/svn/server is your repo-root and you use default layout, you must to define it for clone using additional --stdlayout option. If your tree have more complex structure, you have to describe it using separate options.