merge 指令查看: svn --help
svn merge --help
[svn@svnpreapp02 svntest]$ svn merge --help
merge: Apply the differences between two sources to a working copy path.
usage: 1. merge sourceURL1[@N] sourceURL2[@M] [WCPATH]
2. merge sourceWCPATH1@N sourceWCPATH2@M [WCPATH]
3. merge [-c M[,N...] | -r N:M ...] SOURCE[@REV] [WCPATH]
1. In the first form, the source URLs are specified at revisions
N and M. These are the two sources to be compared. The revisions
default to HEAD if omitted.
2. In the second form, the URLs corresponding to the source working
copy paths define the sources to be compared. The revisions must
be specified.
3. In the third form, SOURCE can be either a URL or a working copy
path (in which case its corresponding URL is used). SOURCE (in
revision REV) is compared as it existed between revisions N and M
for each revision range provided. If REV is not specified, HEAD
is assumed. '-c M' is equivalent to '-r <M-1>:M', and '-c -M'
does the reverse: '-r M:<M-1>'. If no revision ranges are
specified, the default range of 0:REV is used. Multiple '-c'
and/or '-r' options may be specified, and mixing of forward
and reverse ranges is allowed.
WCPATH is the working copy path that will receive the changes.
If WCPATH is omitted, a default value of '.' is assumed, unless
the sources have identical basenames that match a file within '.':
in which case, the differences will be applied to that file.
NOTE: Subversion will only record metadata to track the merge
if the two sources are on the same line of history -- if the
first source is an ancestor of the second, or vice-versa. This is
guaranteed to be the case when using the third form listed above.
The --ignore-ancestry option overrides this, forcing Subversion to
regard the sources as unrelated and not to track the merge.
Valid options:
-r [--revision] ARG : ARG (some commands also take ARG1:ARG2 range)
A revision argument can be one of:
NUMBER revision number
'{' DATE '}' revision at start of the date
'HEAD' latest in repository
'BASE' base rev of item's working copy
'COMMITTED' last commit at or before BASE
'PREV' revision just before COMMITTED
-c [--change] ARG : the change made by revision ARG (like -r ARG-1:ARG)
If ARG is negative this is like -r ARG:ARG-1
-N [--non-recursive] : obsolete; try --depth=files or --depth=immediates
--depth ARG : limit operation by depth ARG ('empty', 'files',
'immediates', or 'infinity')
-q [--quiet] : print nothing, or only summary information
--force : force operation to run
--dry-run : try operation but make no changes
--diff3-cmd ARG : use ARG as merge command
--record-only : mark revisions as merged (use with -r)
-x [--extensions] ARG : Default: '-u'. When Subversion is invoking an
external diff program, ARG is simply passed along
to the program. But when Subversion is using its
default internal diff implementation, or when
Subversion is displaying blame annotations, ARG
could be any of the following:
-u (--unified):
Output 3 lines of unified context.
-b (--ignore-space-change):
Ignore changes in the amount of white space.
-w (--ignore-all-space):
Ignore all white space.
--ignore-eol-style:
Ignore changes in EOL style.
-p (--show-c-function):
Show C function name in diff output.
--ignore-ancestry : ignore ancestry when calculating merges
--accept ARG : specify automatic conflict resolution action
('postpone', 'base', 'mine-conflict',
'theirs-conflict', 'mine-full', 'theirs-full',
'edit', 'launch')
--reintegrate : lump-merge all of source URL's unmerged changes
Global options:
--username ARG : specify a username ARG
--password ARG : specify a password ARG
--no-auth-cache : do not cache authentication tokens
--non-interactive : do no interactive prompting
--trust-server-cert : accept unknown SSL server certificates without
prompting (but only with '--non-interactive')
--config-dir ARG : read user configuration files from directory ARG
--config-option ARG : set user configuration option in the format:
FILE:SECTION:OPTION=[VALUE]
For example:
servers:global:http-library=serf
svn merge branch_url trunk_url local_trunk_address
这行指令就会把 trunk 代码变成 branch_url 对应的版本代码。变更后的代码放在 local_trunk_address 目录中,注意:local_trunk_address 是 事先从svn上当下来的trunk 版本代码路径。之后后就会变成branch_url 对应的版本代码。
svn merge branch_url trunk_url local_trunk_address --dry-run
会输出 比对后的变更信息,并不是branch和trunk的冲突!!
--- Merging differences between repository URLs into 'xut4lxltrunk':
U xut4lxltrunk/xut4-pom/pom.xml
U xut4lxltrunk
merge 冲突:
如果拉出的分支a,修改同一个文件,同一块代码,merge之后,那么本地的trunk 分支中有了a的修改,但是没有提交。此时b分支也修改了同一个文件同一块代码,merge trunk,那么此时会爆出冲突。
Conflict discovered in 'xut4lxltrunk/xut4-pom/pom.xml'.
Select: (p) postpone, (df) diff-full, (e) edit,
(mc) mine-conflict, (tc) theirs-conflict,
(s) show all options:
这很好理解,本地修改的还没有提交,更新肯定有冲突。如果提交了,然后再merge肯定不会冲突。
---------------------
作者:lxlmycsdnfree
来源:CSDN
原文:https://blog.csdn.net/lxlmycsdnfree/article/details/78804764
版权声明:本文为博主原创文章,转载请附上博文链接!