Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
git-svn分支_Svn_Git_Git Svn_Branch - Fatal编程技术网

git-svn分支

git-svn分支,svn,git,git-svn,branch,Svn,Git,Git Svn,Branch,我将git与svn存储库一起使用,一切都很顺利,我用git进行了所有分支,所以我没有在svn上分支,但我用git进行了分支,并将这些分支推到了一个单独的位置。然后,我在需要时从分支提交更改。 但现在我想创建一些实际上存在于我尝试过的svn上的分支: $ git svn branch someFeature -m "message" ,我得到了这个: $ git svn branch someFeature -m "message" Multiple branch paths define

我将git与svn存储库一起使用,一切都很顺利,我用git进行了所有分支,所以我没有在svn上分支,但我用git进行了分支,并将这些分支推到了一个单独的位置。然后,我在需要时从分支提交更改。
但现在我想创建一些实际上存在于我尝试过的svn上的分支:

$ git svn branch someFeature -m "message" 
,我得到了这个:

$ git svn branch someFeature -m "message"  
Multiple branch paths defined for Subversion repository. 
You must specify where you want to create the branch with the 
  --destination argument.
我不知道该如何指定目的地,手册页也不清楚。

如果我读对了:

而不是:

git svn branch someFeature -m "message"
svn中有多个(或没有)目录标记为分支的位置。 查看您的.git/config文件,会有如下部分:

[svn-remote "svn"]
url = file:///someurlto/svn
fetch = trunk:refs/remotes/trunk
branches = branches/*:refs/remotes/*
branches = branches2/*:refs/remotes/*
分支将有多个条目。(或者,如果没有任何分支条目,则第一行应使用标准SVN repo布局。)

因此,在进行分支时,必须指出应该在哪个目录中创建分支:

git svn branch someFeature -m "test" --destination branches2

其中最后一个元素是.git/config中分支行的目录之一。

$git svn branch-m“message”someFeature为Subversion存储库定义了多个分支路径。必须使用--destination参数指定创建分支的位置。仍然是相同的消息。我只看到url=file:///someurlto/svn fetch=trunk:refs/remotes/trunk我在那个文件中没有看到分支啊,那就是问题所在。git不知道把这个分支放在哪里。在那里添加与我的示例中类似的行。(branchs=pathinsvrepo/*:refs/remotes/*)没有trunk/branchs文件夹结构的普通svn repo怎么样?最初的分支部分通过了。但是git svn dcommit失败了。它抱怨文件夹不存在…我也有这个问题-我的解决方案是克隆整个repo,包括标记,就好像你只克隆主干一样,然后你可以dcommit等,但不能推到正确的位置。
[svn-remote "svn"]
url = file:///someurlto/svn
fetch = trunk:refs/remotes/trunk
branches = branches/*:refs/remotes/*
branches = branches2/*:refs/remotes/*
git svn branch someFeature -m "test" --destination branches2