我可以从主干更新分支而不执行合并吗?
我可能只是还没有想清楚这一点,或者也许我只是不知道 Subversion 中已经存在的选项(我当然不是专家)。
我只是想知道,如果我创建了一个分支来开始开发某些新功能,是否有一种更简单的方法可以使分支与主干的最新修订保持同步,而无需经历合并一系列修订的所有麻烦。我希望能够简单地更新并从主干(当然还有分支)获取所有修订,而我提交的更改仅影响分支。这可能吗?我问的有道理吗?
我认为这与合并一系列修订版实际上并没有什么不同。只是我使用 AnkhSVN,它在允许合并之前执行所有这些最佳实践检查,有时感觉它比需要的复杂得多。我的想法是,我想让我的分支与其他开发人员可能对主干所做的任何提交保持同步,这样当我最终将我的分支合并到主干时,一切都会顺利(如)顺利(尽可能)。
I probably just haven't thought this through, or perhaps I'm simply unaware of an already existing option in Subversion (I'm certainly no expert).
I'm just wondering, if I've created a branch to start working on some new feature, if there's an easier way to keep the branch up to date with the trunk's most recent revisions without having to go through all the trouble of merging a range of revisions. I would like to be able to simply update and get all revisions from the trunk (and the branch, of course), while my committed changes only affect the branch. Is this possible? Does what I'm asking make sense?
I suppose this isn't really necessarily different from merging a range of revisions; it's just that I use AnkhSVN, which performs all these best-practice checks before allowing a merge, and sometimes it feels like it's a lot more complicated than it needs to be. The idea is that I want to keep my branch up-to-date with any commits other developers may be making to the trunk so that when I eventually do merge my branch into the trunk, everything goes (as) smoothly (as possible).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
让您的分支与最新的主干签入保持同步称为合并。
我知道合并有时可能是一场皇家噩梦,但这正是合并的本质。
Keeping your branch up to do date with the latest trunk check-ins is called a merge.
I know merging can be a royal nightmare sometimes, but this is precisely what merging is.
TL;博士;不,你必须合并,这里有一些说明
它并不像你想象的那么糟糕。我将概述我使用的命令行的步骤。我将使用 vimidiff 来管理冲突,您可以使用 Meld 或您喜欢的其他差异工具。命令前面有井号“#”标记“
完成”,如果您定期执行,则不会有太多更改。第一次合并后,您需要使用上次合并的修订版本号。因此,在将来的某个时间,该命令将在 svn 日志中查找,以查找上次合并的修订版本,在本例中为 335。合并命令将如下所示
所有其他步骤都相同。
TL;DR; No you must merge, here's some instructions
It's not as bad as you think it is. I will outline the steps from the commandline that I use. I will be using vimidiff to manage the conflicts you can use Meld or someother diff tool that you like. Commands are preceded by the hash '#' mark
Done, if you do it reguarly then there are not many changes. After the first merge you need to use the revision # of the last merge. Therefore some time in the future the command would look in the svn log to find when the revision of the last merge was, in this case 335. The merge command would look like thuse
All other steps are the same.
为了实现这一点,您需要从主干进行范围修订合并。实际上,时不时地对分支进行这种合并以了解主干中发生的情况是一个很好的做法。
我不知道 AnkhSVN 的工具,但“纯”SVN 有非常好的工具,可以使合并操作变得非常简单。 TortoiseSVN 是一个很棒的 Windows 工具,如果您喜欢 Netbeans 对合并也有非常好的图形支持。
To achieve that you need to do range-revision merges from trunk. Actually, it is a good practice to do this kind of merge to a branch from time to time to be up-to-date with what is going on in the trunk.
I don't know about the tools for AnkhSVN, but 'pure' SVN has very good tools that make merge operations quite simple. TortoiseSVN is a great tool for Windows and if you like Netbeans there is a very nice graphical support for merge too.
如果您使用 PHPStorm,您可以尝试使用 GUI 界面
https://www.jetbrains.com /help/idea/2016.1/integrating-changes-to-from-feature-branches.html
If you're using PHPStorm you can try using the GUI interface
https://www.jetbrains.com/help/idea/2016.1/integrating-changes-to-from-feature-branches.html
我不熟悉 AnkhSVN,但您所描述的正是 svn merge 的用途。所以你的问题的答案是否定的。
但是,您可以查看
--reintegrate
选项,看看这是否会让您的生活更轻松。请参阅以下博客文章:
Subversion 合并重新集成
Subversion 1.5 合并跟踪简介
I'm not familiar with AnkhSVN, but what you're describing is exactly what
svn merge
is for. So the answer to your question is no.However, you might check out the
--reintegrate
option to see if that makes your life easier.See these blog posts:
Subversion merge reintegrate
Subversion 1.5 merge-tracking in a nutshell