Git 由于迁移,SVN分支历史记录丢失

Git 由于迁移,SVN分支历史记录丢失,git,svn,subgit,Git,Svn,Subgit,使用GIT和SubGit的初学者:) 在SVN端(Subversion版本1.7.4),开发人员创建了一个分支,该分支不位于Branchs文件夹下,但与主干、标记、分支处于同一级别,即: - trunk - branches - tags - TheBranch 然后,他们将此分支移动到“分支”文件夹下(我们可以看到很多更改): 当我们使用SubGit将关联的存储库迁移到Git时,迁移的分支只包含与移动相关联的修订(ps:操作后没有更新)。尽管如此,SubGit处理的修订数量是正确的,但是在分

使用GIT和SubGit的初学者:)

在SVN端(Subversion版本1.7.4),开发人员创建了一个分支,该分支不位于Branchs文件夹下,但与主干、标记、分支处于同一级别,即:

- trunk
- branches
- tags
- TheBranch
然后,他们将此分支移动到“分支”文件夹下(我们可以看到很多更改):

当我们使用SubGit将关联的存储库迁移到Git时,迁移的分支只包含与移动相关联的修订(ps:操作后没有更新)。尽管如此,SubGit处理的修订数量是正确的,但是在分支移动之前在分支中完成的所有修订都不会显示出来

使用的命令是:

subgit import --svn-url [svn_url_repository] [path_of_git_repo] --username [user_name] --password [password].

我们是否忘记了一个选项?

因为在旧版本中,分支不在“默认”结构文件夹中,它没有迁移到git,因为迁移基本上是逐个版本地进行,并将每个SVN版本作为git提交。 为了解决这个问题,您应该告诉迁移者迁移不在默认主干/分支/标记中的路径。有关更多详细信息,请参阅git svn文档。

“subgit导入”命令是“subgit配置”+“subgit安装”+“subgit卸载”的快捷方式,它仅适用于标准主干/分支/标记存储库布局。在您的情况下,我建议使用以下3个命令,而不是单一的“subgit导入”:

然后在
repo.git/subgit/config
中编辑trunk/branchs/tags/shelfs选项,以提及您的其他分支:

trunk = trunk:refs/heads/master
branches = TheBranch:refs/heads/obsolete/TheBranch
branches = branches/*:refs/heads/*
shelves = shelves/*:refs/shelves/*
tags = tags/*:refs/tags/*
然后使用

$ subgit install repo.git
如果不需要连续同步,请运行

$ subgit uninstall repo.git
SubGit需要在SubGit/config文件中同时提到源分支和目标分支来处理移动

我是SubGit开发人员之一

更新:修复了配置中的一个错误:“:”的两侧应该有相同数量的星号。

感谢您的帮助

我成功地执行了:

subgit configure --svn-url [svn_url_repository] repo.git
然后更新配置文件:

[svn]
trunk = trunk:refs/heads/master
branches = trunk2013:refs/heads/obsolete/*
branches = branches/*:refs/heads/*
shelves = shelves/*:refs/shelves/*
tags = tags/*:refs/tags/*
当我执行时:

install repo.git
SubGit version 3.1.1 ('Bobique') build #3448
INSTALLATION FAILED
error: Failed to load Subversion configuration at 'repo.git\subgit\config'
error: Invalid layout option 'svn.branches': Number of asterisks ('*') on the left and right side of the mapping definition differs, when it should be equal..
经过调查后,我更换了:

branches = trunk2013:refs/heads/obsolete/*
作者:

现在我有了分支机构的历史:)


再次感谢。

哦,你说得对,我会在回答中解决这个问题。我真丢脸!
install repo.git
SubGit version 3.1.1 ('Bobique') build #3448
INSTALLATION FAILED
error: Failed to load Subversion configuration at 'repo.git\subgit\config'
error: Invalid layout option 'svn.branches': Number of asterisks ('*') on the left and right side of the mapping definition differs, when it should be equal..
branches = trunk2013:refs/heads/obsolete/*
branches = trunk2013:refs/heads/obsolete