转: svn合并分支到trunk

时间:2023-01-22 11:19:39

http://sepcot.com/blog/2007/04/svn-merge-branch-trunk

SVN: Merging a Branch into Trunk

 

This is more for my benefit than anything else, but someone might find this useful.

Recently at work, I have taken on more responsibilities. Part of that includes branch control over a few web sites I work on. It took me a while to figure out how to manage everything properly and most of the stuff I found on the web wasn’t much help so I will explain it here.

The source control program I am using is SVN and the source code is stored on a server with SSH access.

MERGE A BRANCH INTO TRUNK

  1. Check out a copy of trunk:
    svn co svn+ssh://server/path/to/trunk
  2. Check out a copy of the branch you are going to merge:
    svn co svn+ssh://server/path/to/branch/myBranch
  3. Change your current working directory to “myBranch”
  4. Find the revision “myBranch” began at:
    svn log --stop-on-copy

    This should display back to you the changes that have been made back to the point the branch was cut. Remember that number (should be rXXXX, where XXXX is the revision number).

  5. Change your current working directory to trunk # Perform an SVN update:
    svn up

    This will update your copy of trunk to the most recent version, and tell you the revision you are at. Make note of that number as well (should say “At revision YYYY” where YYYY is the second number you need to remember).

  6. Now we can perform an SVN merge:
    svn merge -rXXXX:YYYY svn+ssh://server/path/to/branch/myBranch

    This will put all updates into your current working directory for trunk.

  7. Resolve any conflicts that arose during the merge
  8. Check in the results:
    svn ci -m "MERGE myProject myBranch [XXXX]:[YYYY] into trunk"

That is it. You have now merged “myBranch” with trunk.

Updated: June 18th, 2008

Steps 2-4 can be replaced by a remote log lookup:

svn log --stop-on-copy svn+ssh://server/path/to/branch

That is it. You have now merged “myBranch” with trunk.

My thanks to Samuel Wright for bringing that to my attention :-)

BONUS: CUTTING A BRANCH

Cutting a branch is a lot easier than merging a branch. And as an added bonus, I will tell you how.

  1. Perform an SVN copy:
    svn copy svn+ssh://server/path/to/trunk svn+ssh://server/path/to/branch/newBranch -m "Cut branch: newBranch"

That’s all there is to it.

转: svn合并分支到trunk的更多相关文章

  1. svn 合并分支 等

    [转载]svn分支(branch)创建.合并(到trunk).冲突解决. Leave a reply 转载自:http://zccst.iteye.com/blog/1430823 一.创建分支 1, ...

  2. svn 合并分支

    1.将某一主干/分支某一时段的改变,合并到工作空间副本 2.将某一主干/分支与其他主干/分支的改变,合并到工作空间副本

  3. svn 合并分支代码到主干

    1. eclipse 安装subclipse 2. 将主干trunk导入到eclipse中 3. 右键选择team-->合并,注意,去掉红色圈内的选项 4. next 选中select查找svn ...

  4. Eclipse SVN 合并分支/主干

    可以从主干合并到分支,也可以从分支合并到主干,根据需要可以选择合适的选项,如下图:

  5. svn合并分支到主干

    将分支pear_For2.3的最终版本合并到主干pear,操作步骤如下:1.选中主干pear右击-> Team -> 合并,弹出如下所示: 到此分支合并到主干已完成,若代码有冲突需找到冲突 ...

  6. SVN合并分支提示不是祖先关系

    开发:dev 测试:test 开发完成后,需要合并到test然后部署,进入测试. F:主干 合并到那里,那里就是主干(要合并到的分支)[起始] T:分支 从那里合并那里就是分支[结束] 备注:需要精确 ...

  7. svn打分支和合并操作

    1.svn打分支 到trunk里,选择Branch/tag.... 填写分支版本路径 到branch里svn up 一下,就有1.4.0分支了 2.svn合并 到trunk里,选择Merge.. 选择 ...

  8. svn branch and merge(svn切换分支和合并)详解

    下文的实践主要是参考了TortoiseSVN的帮助文档和Subversion的在线文档,Subversion的在线文档:http://svnbook.red-bean.com/en/1.5/svn-b ...

  9. windows 下svn 创建分支 合并分支 冲突

    我用的系统是win7+Subversion 1.7.4.服务器搭建就略过了,我也是从网上找的,基本上就是几个命令吧!我用的CentOs6.5 .网上找了几个命令搭建很快,基本上是: 1.# sudo  ...

随机推荐

  1. 科技来电:不容错过的win10轻度美化攻略

    作为微软不择手段采用弹框.限时.警告等方式强推win10的结果, win10市场占有率大增,微软高兴了,可用户苦了,吹洗剪+杀马特般的metro&传统混血开始菜单.鼻青脸肿般的任务栏.单一颜色 ...

  2. C++ macro(宏)使用小结

    谈起C++中的宏,我们第一个想到的应该就是“#define”,它的基本语法长得像这样: #define macroname(para1, para2, para3, ... ,paran) macro ...

  3. 简单通用JDBC辅助类封装

    哎,最近很好久没在博客园写点东西了,由于工作的原因,接触公司自己研发的底层orm框架,偶然发现该框架在调用jdbc操作的时候参考的是hibernate 里面的SimpleJdbcTemplate,这里 ...

  4. 关于clonezilla

    Clonezilla 是一个很好的系统克隆工具,它可以说是吸取了 Norton Ghost 和 Partition Image 的优点.即不仅支持对整个系统进行克隆,而且也可以克隆单个的分区,这种灵活 ...

  5. C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft\Team Foundation\4.0\Cache\VersionControl.config is not valid and cannot be loaded.

    Recently, we experienced a strange problem with TFS 2010. We spent a few days before we figured it o ...

  6. c# label的内容显示不全

    c# label的内容显示不全.须要设置例如以下属性就可以: 1.将Lable的font属性的字体改成宋体: 2.将AutoSize属性改成true: 然后内容就能够显示所有了.

  7. 在WEB工程的web层中的编程技巧

    本篇以看传智播客方立勋老师的<JDBC入门>之<实现客户关系管理案例>视频有感,从中提取方老师在设计管理系统的简单案例中对自己比较有用的部分,以便日后在开发过程中希望能有所帮助 ...

  8. YUI 和路径相关的参数与module加载之间的关系

    相关参数默认值 使用YUI, 我们可以配置一些和路径相关参数,如base.root.comboBase.cdn, combine.path.fullpath等属性的配置均会影响到YUI的module加 ...

  9. Python eval 函数妙用

    eval 功能:将字符串str当成有效的表达式来求值并返回计算结果. 语法: eval(source, globals, locals) -> value 参数: source:一个Python ...

  10. 三种方法实现CSS三栏布局

    本文由云+社区发表 作者:前端林子 本文会分别介绍三种CSS实现三栏布局的方法,可在浏览器中打开查看效果 1.方法一:自身浮动的方法 实现方法:需要左栏向左浮动,右栏向右浮动,中间设左右margin来 ...