SVN-自动将中继合并到分支 [英] SVN - automate merge of trunk into branch

查看:117
本文介绍了SVN-自动将中继合并到分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在SVN中有一个分支,我想与主干中的更改保持最新。我想做的是有一个脚本或每晚运行的某件事执行此合并,然后在没有合并冲突但如果有合并冲突的情况下以某种方式提交,则提交分支的新版本。我发现了这个帖子,尽管它有所帮助不能做所有事情。

I have a branch in SVN that I want to keep up to date with changes from the trunk. What I would like to do is have a script or something that runs nightly that does this merge and then commits the new version of the branch if there are no merge conflicts but if there are merge conflicts somehow indicate so. I found this post that is somewhat helpful although it doesn't do everything.

我一直无法找到确定是否存在合并冲突的方法,而这正是我所要寻找的。在脚本中添加构建代码然后提交成功将很容易,但是如果没有检查合并冲突的方法将不会成功。

I have been unable to find a way to determine whether there are merge conflicts and this is mostly what I'm looking for. Adding building the code and then committing on success will be easy enough in the script but without having a way to check for merge conflicts this won't be successful.

感谢你们可以提供的任何帮助!

Thanks for any help you guys can provide!

推荐答案

我也遇到了同样的问题,尽管我没有尝试自动合并,因为分支并不多,我是手动完成的。

I had your same exact problem, though I didn't try to automate merge because there were not many branches and I did it manually.

无论如何,最好的选择就像使用脚本一样。您帖子中链接的脚本并不仅执行最后一项必需的操作: commit

Anyway, the best option looks like using scripts. The script linked in your post doesn't do only the last required action: commit

我经常使用Linux,因此,如果我是您,我本应该使用如下的shell脚本:

I often use Linux so, if I was you, I would have used a shell script like the following:

cd /path/to/branch
svn update #just to be sure...
svn merge --non-interactive svn://path/to/trunk
svn commit -m "Automated commit"

SVN可以在批处理脚本中为Windows使用类似的命令

A similar command could be used with SVN for windows in a batch script

这篇关于SVN-自动将中继合并到分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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