有3个选项
选项1。您已经做过的事情(最合理的选择)。
将SVN中的两个项目转换为两个单独的Git存储库。
然后使用GitLab,Atlassian Bitbucket Server或任何其他Git服务器软件设置对存储库的访问。
选项2。将整个SVN存储库视为单个目录。
subgit configure --svn-url /SVN-Repo --layout directory C:\GitRepos\SVN-Repo\repo.git
subgit install C:\GitRepos\SVN-Repo\repo.git
然后你可以运行
subgit uninstall C:\GitRepos\SVN-Repo\repo.git
如果您不需要持续同步。在这种情况下,Git存储库将植根于SVN-Repo。
选项3。一个Git存储库,包含两个项目的分支。
subgit configure --svn-url /SVN-Repo C:\GitRepos\SVN-Repo\repo.git
然后修改repo.git/subgit/config以设置
trunk = Project1/trunk:refs/heads/project1-master
branches = Project2/trunk:refs/heads/project2-master
branches = Project1/branches/*:refs/heads/project1-*
branches = Project2/branches/*:refs/heads/project2-*
shelves = shelves/*:refs/shelves/*
tags = Project1/tags/*:refs/tags/project1-*
tags = Project2/tags/*:refs/tags/project2-*
然后运行
subgit install C:\GitRepos\SVN-Repo\repo.git
然后你可以运行
subgit uninstall C:\GitRepos\SVN-Repo\repo.git
如果您不需要持续同步。
在这种情况下,您有1个Git存储库,其分支以project1-和project2-开头,对应于您的项目。您可以使用project1- / project2-代替project1/ / project2/。
因此,根据您的需要,您可以选择以下3个选项中的一个,但第一个是最好的选项。