git-svn分支 [英] git-svn branching

查看:690
本文介绍了git-svn分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用svn仓库一切都很顺利我用git做了所有分支,所以我没有在svn上分支,但是我用git分支并将这些分支推送到一个单独的位置。然后我在需要的时候从分支提交了更改。

但是现在我想创建一些实际存在于svn的分支我试过:

  $ git svn branch someFeature -mmessage

,这:

  $ git svn分支someFeature -m消息
为Subversion存储库定义的多个分支路径。
您必须指定要在哪里创建带有
--destination参数的分支。

我应该如何指定目的地我无法弄清楚,手册页是不是清除也。

解决方案

你有多个(或没有)svn目录标记为分支的地方。
看看你的.git / config文件,会有这样的部分:

  [svn-remotesvn ] 
url = file:/// someurlto / svn
fetch = trunk:refs / remotes / trunk
branches = branches / *:refs / remotes / *
branches = branches2 / *:refs / remotes / *

分支会有多个条目。 (或者,如果您没有任何分支条目,则第一行应该使用标准的SVN仓库布局)。

因此,分支时必须指出哪些目录分支应该被创建:

  git svn branch someFeature -mtest--destination branches2 

code>

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


I am using git with an svn repository everything is going fine I did all my branching with git so I did not branch on svn but I branched with git and pushed those branches to a separate location. Then I commited changes from the branch when needed.
But now I want to create some branches that actually exist on svn I tried:

$ git svn branch someFeature -m "message" 

,and I got this:

$ 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.

How should I specify the destination I can't figure this out and the man page isn't that clear also.

解决方案

You have multiple (or no) directories from svn marked as place for branches. Look into you .git/config file, there would be section like that:

[svn-remote "svn"]
url = file:///someurlto/svn
fetch = trunk:refs/remotes/trunk
branches = branches/*:refs/remotes/*
branches = branches2/*:refs/remotes/*

There will be multiple entries for branches. (Alternately, if you don't have any branch entries, the first line should work with a standard SVN repo layout.)

So, when branching you must point in which directory the branch should be created:

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

where the last element is one of the directories from branches lines in .git/config.

这篇关于git-svn分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆