- 浏览: 683911 次
- 性别:
- 来自: 上海
文章分类
最新评论
-
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 500@echo off echo. echo Removin ... -
How to Enable “Open Command Window Here” Option in Context Menu in Windows Vista
2015-07-29 19:58 885In Windows Vista and later, if ... -
Shell script for stress testing
2014-10-23 00:05 738ParseInstance() { Files=`f ... -
Shell操作字符串
2014-08-19 09:42 608在做shell批处理程序时候,经常会涉及到字符串相关操作 ... -
Linux设置shell提示符的方法
2014-05-16 16:52 690转自: http://www.linuxsong.org/2 ... -
Win7 - Failed to set image as wallpaper
2014-04-29 12:02 848Problem: Right click on an im ... -
JBoss 6.0.0 Final 启动慢且占用大量内存的解决方法
2014-02-22 22:53 12861. Patch jboss.jar (Can be op ... -
Linux Used内存到底哪里去了
2014-02-22 15:31 819原创文章,转载请注明: 转载自系统技术非业余研究 本文 ... -
Killing process via shell script
2014-02-14 15:59 474#!/bin/sh #Check input parame ... -
Install Chocolatey when you access Internet via proxy
2014-01-24 16:43 1120Modify install.ps1 like bel ... -
Startup script for configuring a workstation
2014-01-24 16:29 753@echo off ping -n 100 127 ... -
Shell skills take away
2014-01-16 17:45 7491. Empty log files in batch ... -
Building a java classpath from a windows batch file (Reposted)
2014-01-06 16:10 833A great feature introduced wi ... -
Shell操作数组
2014-01-03 19:20 918#pids=(123 345 678)pids=$(ps -e ... -
shell参数传递有空格的问题
2013-12-27 19:34 5669$# 传给脚本的参数个数$0 脚本本身的名字$1 传递给该s ... -
Shell Usage Sample
2013-12-27 19:08 1225Sample 1: if [ $# -ne 1 ] t ... -
用shell判断一个字符串是不是全为数字 & 取字符串的第N个字符(转)
2013-12-27 18:57 1558(1)判断一个字符串是不是全为数字 01 ... -
基本正则表达式和扩展正则表达式的区别
2013-12-23 09:31 1393sed默认的匹配方式是基本正则表达式,用基本正则表达式匹配时. ... -
Delete file with name start with dash
2013-11-25 11:52 780Sample file name: -a 1. rm - ...
相关推荐
NULL 博文链接:https://linleizi.iteye.com/blog/1962031
介绍了svn主干,分支和标记的相关概念、相互关系及有关的操作方法
多分支开发,Merge是一个绕不过的话题,不管是Git还是SVN,公司用的是SVN,之前对于SVN的Merge没有很好的研究,出了些状况,这个问题不解决,顺畅地进行多分支开发就是海市蜃楼,下定决心把这块给完全搞透,在百度上...
很显然不能在当前开发的代码基础上进行bug修复工作完美的解决方案是:在当时完成的那个版本中进行bug fix,这样带来的好处是:1:bug修复好之后可立即上线,
SVN的标准目录结构:trunk、branches、tags
svn trunk branches tags
SVNMerge源代码SVNMerge源代码SVNMerge源代码
规范如何使用SVN trunk branch tag
资源中有 SVN 主干(trunk)、分支(branch )、标记(tag) 的详细解释,和作用 并带 SVN分支与合并 的详细操作文档(附图)。 SVN分支与合并的总结 1.分支(branche)的创建。 1、分支创建是建立在主干上的。 2、创建...
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
how to make a project with SVN+MEAVEN,使用svn和maven构建java工程。
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 ...
在SVN中使用分支/Branch进行版本控制
svn的合并和冲突的解决一直以来困扰着很多人,该文档以图解的形式举例介绍svn的merge与冲突。
多个版本的SVN整合,包含对应的TOSVN安装包。打包到一起了
Chameleon_2.1svn_r2070_trunk_pkg.zip
SVN的目录结构解释与SVN创建分支、合并分支、切换分支的操作详解。