7

I'm aware how to migrate a SVN repository which has the following structure

SVN Repo1
  + trunk
  + branches
  + tags

I could use the following command

git svn clone svn://hostname/Repo1/ --prefix=svn/ --no-metadata --authors-file "authors-transform.txt" --stdlayout c:\mytempdir

see https://learn.microsoft.com/en-us/azure/devops/repos/git/perform-migration-from-svn-to-git and https://stackoverflow.com/a/3972103/7556646.

But when my SVN repository has the following structure

SVN Repo2
  + Project1
      + trunk
      + branches
      + tags
  + Project2
      + trunk
          + Project1 <-- external to ^/Project1/trunk
      + branches
      + tags
  + Project3
      + trunk
          + Project1 <-- external to ^/Project1/trunk
      + branches
      + tags

I've no idea how to convert it to git.

Should I migrate each project in Repo2? In that case the svn externals are missing. Or is there a way to migrate the hole Repo2?

Remark: A SVN client user was just checking out Project2 or Project3 and not Project1.

Wollmich
  • 1,616
  • 1
  • 18
  • 46

1 Answers1

0

As far as I know, there is no straightforward way of doing the equivalent of an SVN external in Git. One potential option could be to create a separate repository for Project1 and then use this repository as a submodule inside the Project2 and Project3 directories. This will mean that once code is changed in this new repository for project1 the submodules in both Project2 and Project3 can be easily updated.

Here is more info about Submodules

Joshua Zeltser
  • 488
  • 2
  • 9