svn之merge
【svn之merge】
1. merge SOURCE[@REV] [TARGET_WCPATH] (the 'sync' merge)
This form is called a 'sync' (or 'catch-up') merge:
svn merge SOURCE[@REV] [TARGET_WCPATH]
A sync merge is used to fetch all the latest changes made on a parent branch. In other words, the target branch has originally been created by copying the source branch, and any changes committed on the source branch since branching are applied to the target branch. This uses merge tracking to skip all those revisions that have already been merged, so a sync merge can be repeated periodically to stay up-to-date with the source branch.
SOURCE specifies the branch from where the changes will be pulled, and TARGET_WCPATH specifies a working copy of the target branch to which the changes will be applied. Normally SOURCE and TARGET_WCPATH should each correspond to the root of a branch. (If you want to merge only a subtree, then the subtree path must be included in both SOURCE and TARGET_WCPATH; this is discouraged, to avoid subtree mergeinfo.)
TARGET_WCPATH is a working copy path; if omitted, '.' is assumed.
svn merge ^/trunk
2. merge [-c M[,N...] | -r N:M ...] SOURCE[@REV] [TARGET_WCPATH] (the 'cherry-pick' merge)
This form is called a 'cherry-pick' merge:
svn merge [-c M[,N...] | -r N:M ...] SOURCE[@REV] [TARGET_WCPATH]
A cherry-pick merge is used to merge specific revisions (or revision ranges) from one branch to another. By default, this uses merge tracking to automatically skip any revisions that have already been merged to the target; you can use the --ignore-ancestry option to disable such skipping.
SOURCE is usually a URL. The optional '@REV' specifies only the peg revision of the URL and does not affect the merge range; if REV is not specified, the HEAD revision is assumed. If SOURCE is a working copy path, the corresponding URL of the path is used, and the default value of 'REV' is the base revision (usually the revision last updated to).
TARGET_WCPATH is a working copy path; if omitted, '.' is assumed.
svn merge -c50 ^/trunk
svn merge -c50,54,60 -r65:68 ^/trunk
3. merge --reintegrate SOURCE[@REV] [TARGET_WCPATH] (the 'reintegrate' merge)
This form is called a 'reintegrate merge':
svn merge --reintegrate SOURCE[@REV] [TARGET_WCPATH]
In a reintegrate merge, an (e.g. feature) branch is merged back to its originating branch. In other words, the source branch has originally been created by copying the target branch, development has concluded on the source branch and it should now be merged back into the target branch.
SOURCE is the URL of a branch to be merged back. If REV is specified, it is used as the peg revision for SOURCE; if REV is not specified, the HEAD revision is assumed.
TARGET_WCPATH is a working copy of the branch the changes will be applied to.
svn merge --reintegrate ^/feature
After the reintegrate merge, the feature branch cannot be synced to the trunk again without merge conflicts. If further work must be done on the feature branch, it should be deleted and then re-created.
4. merge SOURCE1[@N] SOURCE2[@M] [TARGET_WCPATH]
(the '2-URL' merge)
This form is called a '2-URL merge':
svn merge SOURCE1[@N] SOURCE2[@M] [TARGET_WCPATH]
Two source URLs are specified, together with two revisions N and M. The two sources are compared at the specified revisions, and the difference is applied to TARGET_WCPATH, which is a path to a working copy of another branch. The three branches involved can be completely unrelated.
You should use this merge variant only if the other variants do not apply to your situation, as this variant can be quite complex to master.
If TARGET_WCPATH is omitted, a default value of '.' is assumed.However, in the special case where both sources refer to a file node with the same basename and a similarly named file is also found within '.', the differences will be applied to that local file. The source revisions default to HEAD if omitted.
The sources can also be specified as working copy paths, in which case the URLs of the merge sources are derived from the working copies.
【Merge Tracking】
- Merge Tracking -
Subversion uses the svn:mergeinfo property to track merge history. This property is considered at the start of a merge to determine what to merge and it is updated at the conclusion of the merge to describe the merge that took place. Mergeinfo is used only if the two sources are on the same line of history -- if the first source is an ancestor of the second, or vice-versa (i.e. if one has originally been created by copying the other). This is verified and enforced when using sync merges and reintegrate merges.
The --ignore-ancestry option prevents merge tracking and thus ignores mergeinfo, neither considering it nor recording it.
- Merging from foreign repositories -
Subversion does support merging from foreign repositories. While all merge source URLs must point to the same repository, the merge target working copy may come from a different repository than the source. However, there are some caveats. Most notably, copies made in the merge source will be transformed into plain additions in the merge target. Also, merge-tracking is not supported for merges from foreign repositories.
svn之merge的更多相关文章
- SVN SVN合并(Merge)与拉取分支(Branch/tag)操作简介
SVN合并(Merge)与拉取分支(Branch/tag)操作简介 合并(Merge) 例子:把对feature_branch\project_name_v3.3.7_branch的修改合并到deve ...
- svn resolve/merge
svn merge http://svn.a.com/branches/20150129_168954_sales-impr_1 svn resolve --accept working web/sr ...
- svn的merge使用例子
先说说什么是branch.按照Subversion的说法,一个branch是某个development line(通常是主线也即trunk)的一个拷贝,见下图: branch存在的意义在于,在不干扰t ...
- SVN代码merge
如何merge代码?建议用命令搞merge,客户端图形界面不是很给力.SVN 1.5以上版本,可以使用SVN的自动合并:将主干合并到分支:进入分支目录,执行命令: svn merge http://s ...
- SVN合并(merge)的使用
使用svn几年了,一直对分支和合并敬而远之,一来是由于分支的管理不该我担心,二来即使涉及到分支的管理,也不敢贸然使用合并功能,生怕合并出了问题对团队造成不良影响.最基本的原因是,自己对分支的目的和合并 ...
- SVN Cannot merge into a working copy that has local modifications
我尝试了 主支,分支都提交,但是依然无法合并. 最终,我在服务器上将分支删除,然后主支在拷贝过去. 一,打开服务器资源 二,删除分支 三,拷贝主支到分支 四,刷新分支,就能看到了. 然后在分支项目中, ...
- svn上想回滚代码怎么办?——svn merge 命令
小博客断更了很久,最近想接着尝试建立写作的习惯,把自己工作生活遇到的有用知识沉淀下来.尽管微信公共账号比较火,但个人觉得这种不能用搜索引擎检索的东西完全就是历史的倒退,就像 RSS 这种提高信息传播效 ...
- svn merge 回滚
聊一聊 svn merge 命令. svn 是啥就不用介绍了吧,谁用谁知道.有了 svn,开发者只要把代码提交上去,无论山崩地裂.电脑进水.硬盘格式化,哪怕换了一台电脑,都能随时把代码找回来.不过从自 ...
- SVN用法(merge,branch,switch)
SVN merge命令用法 使用svn的merge命令,把一个版本的变化合并到另一个版本.我使用的tortoise,在当前的工作目录点击右键,选择merge,在from框输入源url,在revisio ...
随机推荐
- linux时间管理 之 jiffies
1.jiffies 又称时钟滴答,是一个全局变量,它的值在系统引导的时候初始化为0,在时钟中断初始化完成后,每次时钟中断发生,在时钟中断处理例程中都会将jiffies的值 +1. jiffies_64 ...
- Arcgis for Js之GeometryService实现测量距离和面积
距离和面积的测量时GIS常见的功能,在本节,讲述的是通过GeometryService实现测量面积和距离.先看看实现后的效果: 距离 ...
- 10.排序数组中和为给定值的两个数字[Find2NumbersWithGivenSum]
[题目] 输入一个已经按升序排序过的数组和一个数字,在数组中查找两个数,使得它们的和正好是输入的那个数字.要求时间复杂度是O(n).如果有多对数字的和等于输入的数字,输出任意一对即可. 例如输入数组1 ...
- ORM版,学生管理系统03
关于老师信息管理 建立多对多关系 第一种(通过外键建立) 自己写类,自己使其建立关系 缺点: 不能用Django ORM 多对多操作的语法 class Teacher(models.Model): t ...
- JFinal自定义FreeMarker标签
为什么采用freemarker? 1.模板技术,不依附于语言和框架,前端和后端解耦,便于分工协作,更好的协同. 2.页面相应速度快 3.前端非常的灵活,采用自定义标签可以在不更改后端的基础上很容易的构 ...
- 深入理解java虚拟机-第八章
第8章 虚拟机字节码执行引擎 8.2 运行时栈帧结构 栈帧(Stack Frame)是用于支持虚拟机进行方法调用和方法执行的数据结构. 每一个栈帧包括了局部变量表.操作数栈.动态连接.方法返回地址和一 ...
- 【如何入门ACM】
第一阶段:先刷水题,水题,就是几乎不牵扯算法.需要自己想方法解决.这样的题,一是锻炼逻辑和思维的严谨,二是锻炼代码能力.一般做到60-200题左右. 第二阶段:渐渐的学一些简单的算法,或者专题训练,或 ...
- W3Schools SQL Quiz
W3Schools SQL Quiz SQL QUIZ Points: 25 out of 25 1. What does SQL stand for? You answered: Structure ...
- Dropping tests(二分加01数字)
个人心得:不能说题目太难,而是自己思维太菜,我开始以为这怎么都想不到的,但是学长说不是很简单吗,好吧我信了,我太low. 其实单纯二分只用于搜索,但是这种逆向答案二分确实比较难理解.给大神代码 [一些 ...
- NOIp2018 D2T3 defense——树上倍增
题目:https://www.luogu.org/problemnew/show/P5024 考场上只会写n,m<=2000的暴力,还想了想A1和A2的情况,不过好像只得了A1的分.然后仔细一看 ...