zoukankan      html  css  js  c++  java
  • 转: svn合并分支到trunk

    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.

  • 相关阅读:
    模拟最烂的网速
    TableView编辑状态下跳转页面的崩溃处理
    Swift的Optional类型
    autolayout之后获取uiview的frame
    Swift中的闭包(Closure)[转]
    Swift1.2与Xcode6.3 beta
    python技巧31[python中使用enum][转]
    Python初学者的捷径[译]
    tornado+bootstrap急速搭建你自己的网站
    Windows下nginx+tomcat实现简单的负载均衡、动静分离等
  • 原文地址:https://www.cnblogs.com/wucg/p/5866023.html
Copyright © 2011-2022 走看看