git-svn 分支

发布于 2024-09-04 09:22:36 字数 484 浏览 5 评论 0原文

我正在使用 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.

我应该如何指定目的地我无法弄清楚这一点,手册页也不是那么清楚。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

贵在坚持 2024-09-11 09:22:36

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

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

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

因此,在分支时,您必须指向应在哪个目录中创建分支:

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

最后一个元素是其中之一.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/*

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文