eclipse Subclipse 中的分支和合并
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7995690/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Branching and merging in Subclipse
提问by vemv
After following all the articles I could find and trying it myself in many different ways, I'm getting a bit desperate towards performing branching and merging in Subclipse.
按照我能找到的所有文章并以多种不同的方式自己尝试之后,我对在 Subclipse 中执行分支和合并感到有些绝望。
All I get is tree conflicts (even for example projects), errors ("file already exists")...
我得到的只是树冲突(即使是例如项目)、错误(“文件已经存在”)......
I've used svn copy
as well (which apparently is a better practice than setting a branch
property) as the built-in branch support.
我也使用svn copy
(这显然比设置branch
属性更好)作为内置分支支持。
How to branch a directory to a second one, in the best way possible?
如何以最佳方式将目录分支到第二个目录?
And how to merge changes from any of these directiories to the other one?
以及如何将这些目录中的任何一个目录的更改合并到另一个目录?
回答by vemv
So I figured it out:
所以我想通了:
Creating the branch
创建分支
Right-click the trunk folder, select Team > Branch/Tag. The Copy to URL:path must be an absolutely new, non-existing path; you can't either select an already existing path, or create a directory through the dialog and then choose that one.
右键单击主干文件夹,选择Team > Branch/Tag。将复制到网址:路径必须是一个全新的,非现有路径; 您不能选择一个已经存在的路径,也不能通过对话框创建一个目录,然后选择那个。
Then click finishunless you need something else.
然后点击完成,除非你需要别的东西。
Switching to the branch
切换到分支
Update to HEAD, right-click the project folder, select Team > Switch to another Branch. Click the Select...button. If the folder you just created doesn't appear, right-click the browser and refresh. Done.
更新到 HEAD,右键单击项目文件夹,选择Team > Switch to another Branch。单击选择...按钮。如果您刚刚创建的文件夹没有出现,请右键单击浏览器并刷新。完毕。
Merging from the trunk to the branch, or viceversa
从主干合并到分支,反之亦然
First, make sure the Collabnet Merge Client is installed. You'll find it in the same directory that one uses to fetch Subclipse 1.X. Otherwise chances are you'll get tree conflicts.
首先,确保安装了 Collabnet Merge Client。您会在用于获取 Subclipse 1.X 的同一目录中找到它。否则你很可能会遇到树冲突。
Right-click either the branch or the trunk select Team > Merge. Choose Merge a range from revisionsif the merge goes from the trunk to the branch. Otherwise select Reintegrate a branch.
右键单击分支或主干,选择Team > Merge。如果合并从主干到分支,请选择合并范围从修订。否则选择Reintegrate a branch。
Click Next. Select the merge source and you're done.
单击下一步。选择合并源就大功告成了。
回答by JB Nizet
You should only branch and merge the whole project. Not individual directories inside the project. It makes things much simpler. For how to do it, refer to the SVN book. It's very well explained and details the usual techniques : feature branches, maintenance branches, etc.
您应该只分支和合并整个项目。不是项目内的单个目录。它使事情变得简单得多。怎么做,参考SVN书。它很好地解释并详细介绍了常用技术:功能分支、维护分支等。