有3个选项
选项 1.你已经做了什么(最合理的选项)。将 SVN 中的两个项目转换为 2 个独立的 Git 存储库。然后使用 GitLab、Atlassian Bitbucket Server 或任何其他 Git 服务器软件设置对存储库的访问。
选项 2.将整个 SVN 存储库视为单个目录。
subgit configure --svn-url <svn_server>/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_server>/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 个选项之一,但第一个是最好的。