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

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

问题描述

我在 svn 存储库中使用 git 一切正常我用 git 完成了所有分支,所以我没有在 svn 上分支,但我用 git 分支并将这些分支推送到单独的位置.然后我在需要时从分支提交更改.
但是现在我想创建一些实际存在于我尝试过的 svn 上的分支:

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" 

,我得到了这个:

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

推荐答案

您有多个(或没有)来自 svn 的目录被标记为分支位置.查看你的 .git/config 文件,会有这样的部分:

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/*

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

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

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

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

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

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