2010-10-21 44 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/