2010-10-21 101 views
7

我们的SVN服务器使用嵌套分支有一个叫做开发树干和树枝住在如何通过混帐svn的

 
/Branches/Release/1.0/ 
       /2.0/ 
       /2.3.4/ 

我的东西克隆它像git svn clone -T Dev ... -b Branches ...
当我运行git branch 2.1 remotes/Release/2.1我得到:
fatal: Not a valid object name: 'remotes/Release/2.1'.

  • 如何引用远程分支?
  • 我需要重新克隆不同ARGS?
+0

我认为你是SOL芽:/你导入了一个分支:释放文件夹。 – Aren 2010-10-21 00:21:24

+0

我应该如何解决这个问题的下一次我会克隆? – 2010-10-21 00:22:54

+0

可能的复制到http://stackoverflow.com/questions/258590/how-do-i-import-svn-branches-rooted-in-different-directories-into-git-using-git – fmuecke 2014-05-06 09:13:04

回答

11

正如在“How do I import svn branches rooted in different directories into git using git-svn?”所提到的,你需要的初始导入过程中抓住所有的嵌套分支:

[svn-remote "svn"] 
    url = svn://svnserver/repo 
    fetch = trunk:refs/remotes/trunk 
    branches = branches/*/*:refs/remotes/* 
    tags = tags/*:refs/remotes/tags/* 

即在this thread也有描述。
对于更加复杂的SVN分公司布局(如branches within trunk!),SVN回购协议的修改可能是为了首先,必须制定一个git - svn的集成之前。

由于Git1.6“1.6.x提供了深度克隆,因此多个通配符可与--branches选项一起使用”,如“Cloning a Non-Standard Svn Repository with Git-Svn”中所述。

git svn clone https://svn.myrepos.com/myproject web-self-serve --trunk=trunk --branches=branches/*/* --prefix=svn/