- 浏览: 697797 次
- 性别:
- 来自: 上海
文章分类
最新评论
-
yzs5273:
没什么用。都试过了
WIN7下CS不能全屏的解决方法 -
di1984HIT:
不错,学习了
读取本地计算机中的安装程序列表 -
ffedu:
[flash=200,200][url][img][list] ...
linux/unix中如何用find命令详解,非常详细的介绍,比man find强100倍(转) -
lintghi:
...
Log4j使用相对路径指定log文件及使用总结 -
nick.s.ni:
唉,Java中引用的包没有介绍啊,如果数据库用UTF-8的格式 ...
Oracle 中Java 对象与PL/SQL类型的映射及使用(转)
需求一:
有一个客户想对产品做定制,但是我们并不想修改原有的svn中trunk的代码。
方法:
用svn建立一个新的branches,从这个branche做为一个新的起点来开发
- svn copy svn://server/trunk svn://server/branches/ep -m "init ep"
Tip:
如果你的svn中以前没有branches这个的目录,只有trunk这个,你可以用
- svn mkdir branches
新建个目录
需求二:
产品开发已经基本完成,并且通过很严格的测试,这时候我们就想发布给客户使用,发布我们的1.0版本
- svn copy svn://server/trunk svn://server/tags/release-1.0 -m "1.0 released"
咦,这个和branches有什么区别,好像啥区别也没有?
是的,branches和tags是一样的,都是目录,只是我们不会对这个release-1.0的tag做修改了,不再提交了,如果提交那么就是branches
需求三:
有一天,突然在trunk下的core中发现一个致命的bug,那么所有的branches一定也一样了,该怎么办?
- svn -r 148:149 merge svn://server/trunk branches/ep
其中148和149是两次修改的版本号。
SVN: Merging a Branch into Trunk
Added: April 11th, 2007 (tagged with: coding)
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
-
Check out a copy of trunk:
svn co svn+ssh://server/path/to/trunk
-
Check out a copy of the branch you are going to merge:
svn co svn+ssh://server/path/to/branch/myBranch
- Change your current working directory to "myBranch"
-
Find the revision "myBranch" began at:
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).
svn log --stop-on-copy
- Change your current working directory to trunk
-
Perform an SVN update:
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).
svn up
-
Now we can perform an SVN merge:
This will put all updates into your current working directory for trunk.
svn merge -rXXXX:YYYY svn+ssh://server/path/to/branch/myBranch
- Resolve any conflicts that arose during the merge
-
Check in the results:
svn ci -m "MERGE myProject myBranch [XXXX]:[YYYY] into trunk"
That is it. You have now merged "myBranch" with trunk.
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.
-
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.
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
Every time I need to do this I try to use svn's --help which is only possible to decipher if you already know what to do. Then I spend too much time on the internet looking for the answer. And finally I break down and ask my tech lead. With much shame. I'm putting this up here so I least I'll know where to find it. Maybe you too.
In the directory of the branch:
svn merge -r 1001:1002 https://svn.dev.your/repo/trunk/src .
If you checked in some files in revision 1002, then what you're saying is that you only want the changes from that checkin with '-r 1001:1002' Which is followed by the url of the trunk (where the changes were checked in) and a '.' to say that you want to merge to the current directory. Use '--dry-run' if you want to see what would happen without actually screwing anything up. After the merge is successful, you now have some modified files in the branch you can check in.
Done and done.
Merge a branch back into the trunk (assuming that you have a working copy of the trunk, and that the branch was created in revision 250):
$ svn merge -r 250:HEAD http://svn.red-bean.com/repos/branches/my-branch
U myproj/tiny.txt
U myproj/thhgttg.txt
U myproj/win.txt
U myproj/flo.txt
If you branched at revision 23, and you want to merge changes on trunk into your branch, you could do this from inside the working copy of your branch:
$ svn merge -r 23:30 file:///tmp/repos/trunk/vendors
U myproj/thhgttg.txt
…
To merge changes to a single file:
$ cd myproj
$ svn merge -r 30:31 thhgttg.txt
U thhgttg.txt
发表评论
-
Do POST with CURL
2016-01-18 16:58 0th fields: curl --data " ... -
DOS Command to remove shortcut arrow and add open command window here
2015-07-30 14:56 540@echo off echo. echo Removin ... -
How to Enable “Open Command Window Here” Option in Context Menu in Windows Vista
2015-07-29 19:58 935In Windows Vista and later, if ... -
Shell script for stress testing
2014-10-23 00:05 789ParseInstance() { Files=`f ... -
Shell操作字符串
2014-08-19 09:42 652在做shell批处理程序时候,经常会涉及到字符串相关操作 ... -
Linux设置shell提示符的方法
2014-05-16 16:52 736转自: http://www.linuxsong.org/2 ... -
Win7 - Failed to set image as wallpaper
2014-04-29 12:02 887Problem: Right click on an im ... -
JBoss 6.0.0 Final 启动慢且占用大量内存的解决方法
2014-02-22 22:53 13571. Patch jboss.jar (Can be op ... -
Linux Used内存到底哪里去了
2014-02-22 15:31 872原创文章,转载请注明: 转载自系统技术非业余研究 本文 ... -
Killing process via shell script
2014-02-14 15:59 509#!/bin/sh #Check input parame ... -
Install Chocolatey when you access Internet via proxy
2014-01-24 16:43 1160Modify install.ps1 like bel ... -
Startup script for configuring a workstation
2014-01-24 16:29 800@echo off ping -n 100 127 ... -
Shell skills take away
2014-01-16 17:45 7971. Empty log files in batch ... -
Building a java classpath from a windows batch file (Reposted)
2014-01-06 16:10 874A great feature introduced wi ... -
Shell操作数组
2014-01-03 19:20 958#pids=(123 345 678)pids=$(ps -e ... -
shell参数传递有空格的问题
2013-12-27 19:34 5775$# 传给脚本的参数个数$0 脚本本身的名字$1 传递给该s ... -
Shell Usage Sample
2013-12-27 19:08 1267Sample 1: if [ $# -ne 1 ] t ... -
用shell判断一个字符串是不是全为数字 & 取字符串的第N个字符(转)
2013-12-27 18:57 1620(1)判断一个字符串是不是全为数字 01 ... -
基本正则表达式和扩展正则表达式的区别
2013-12-23 09:31 1486sed默认的匹配方式是基本正则表达式,用基本正则表达式匹配时. ... -
Delete file with name start with dash
2013-11-25 11:52 854Sample file name: -a 1. rm - ...
相关推荐
综上所述,理解和熟练运用SVN的trunk、branch、tag以及merge机制对于软件开发团队来说至关重要,它们是实现高效协同开发、保持代码整洁有序的基础。同时,使用像"admintools"这样的辅助工具可以进一步提升SVN的管理...
本文将深入探讨 SVN 中的 trunk、branch 和 tag 三个核心概念,以及它们在实际开发场景中的应用。 首先,trunk(主干或主线)是项目的主要开发分支,代表了项目的最新稳定状态。新功能的开发通常在这个分支上进行,...
通过对SVN中Trunk、Branch、Tag的概念及使用方法的介绍,我们可以更好地理解如何高效地使用SVN来进行版本控制。遵循这些约定能够有效提升团队协作效率,减少代码冲突,确保项目的稳定性和可持续发展。
svn commit -m "Merge changes from branch to trunk" ``` ##### 5. 修改主干内容 接下来,对 `trunk/examples1` 进行一些更改,并提交这些更改到服务器。 ```bash # 修改trunk/examples1的内容 # 提交更改到...
当需要建立 branch 或 tag 时,可以使用 SVN 中的 copy 操作,例如,从 trunk 中 copy 到 branches 中,或者从 trunk 中 copy 到 tags 中。 权限控制 在 SVN 中,可以使用 authz 文件控制目录的访问权限。例如,...
多分支开发,Merge是一个绕不过的话题,不管是Git还是SVN,公司用的是SVN,之前对于SVN的Merge没有很好的研究,出了些状况,这个问题不解决,顺畅地进行多分支开发就是海市蜃楼,下定决心把这块给完全搞透,在百度上...
- **需求三**:如果在`trunk`中发现了一个致命bug(如在版本149),需要在所有分支上修复,可以使用`svn merge -r 148:149 svn://server/trunk branches/ep`命令,将`trunk`上的修复合并到`branches/ep`。...
资源中有 SVN 主干(trunk)、分支(branch )、标记(tag) 的详细解释,和作用 并带 SVN分支与合并 的详细操作文档(附图)。 SVN分支与合并的总结 1.分支(branche)的创建。 1、分支创建是建立在主干上的。 2、创建...
SVNMerge是SVN的一个辅助工具,主要用于合并分支或解决代码冲突。在这个特定的上下文中,"SVNMerge源代码"指的是该工具的原始编程语言代码,可能是用C、C++或者Python等语言编写的,它允许开发者深入理解工具的工作...
`svn merge`是Subversion(简称svn)中的关键命令,用于将一个分支或标记的修改合并到另一个分支。在版本控制系统中,合并是协同开发的核心操作,它允许团队成员同步各自的工作,避免代码冲突。以下是一些关于`svn ...
The document you are currently reading contains a lot of general information about converting from CVS, and specifically how to use cvs2svn to convert your repository to Subversion. cvs2git....
项目中使用的是1.4.7,作为...Change the format of a Subversion working copy to that of SVN_VERSION. --skip-unknown-format : skip directories with unknown working copy format and continue the update
VSS2SVN is a simple utility project that aims to help migrate the contents of a source safe database to subversion. To do that, VSS2SVN uses two key assemblies: The Microsoft sourcesafe interop ...
2. 使用SVN命令(如`svn copy`)或客户端工具来复制`trunk`到新的分支路径。 3. 更新你的工作副本到新创建的分支,此时你就可以在这个分支上进行独立的开发了。 ### 合并分支 合并分支的步骤: 1. 选择要合并的分支...
在使用Subversion(SVN)版本控制系统的过程中,有时会遇到“Failed to run the WC DB work queue”的错误提示,这通常是由于工作副本(Working Copy)数据库出现问题导致的。SVN使用SQLite3作为其本地数据库来存储...
Chameleon 2.1svn_r2070_trunk_pkg.zip 是一个特定版本的Chameleon更新,包含了版本号为2.1的源代码控制版本(Subversion,简称svn)的修订版2070,从trunk分支提取。这个zip压缩包包含了一个名为"Chameleon_2.1svn_...