SVN 命令行
svn help add auth blame cat changelist checkout cleanup commit copy delete diff export import info list lock log merge mergeinfo mkdir move patch propdel propedit propget proplist propset relocate resolve resolved revert status switch unlock update upgrade > svn_help.txt
usage: svn <subcommand> [options] [args]
Subversion command-line client.
Type 'svn help <subcommand>' for help on a specific subcommand.
Type 'svn --version' to see the program version and RA modules
or 'svn --version --quiet' to see just the version number.
Most subcommands take file and/or directory arguments, recursing
on the directories. If no arguments are supplied to such a
command, it recurses on the current directory (inclusive) by default.
大多数子命令都需要文件和/或目录参数(命令操作目标),对目录进行递归。如果没有提供参数,它默认会在当前目录(包含)上递归。
Available subcommands:
add 添加文件和目录置于版本控制之下,下一次提交中将添加至存储库。
auth 管理身份验证凭据。
blame (praise, annotate, ann) 显示文件每一行上一次(或下一次)更改版本点
cat 按指定规则,从仓库输出文件或URL的内容。
changelist (cl) 对本地副本库的文件进行分组
checkout (co) 从存储库中检出工作副本
cleanup 递归清理工作副本,删除写入锁定,恢复未完成的操作等。
commit (ci) 将更改从工作副本发送到存储库。
copy (cp) 将文件和目录复制到工作副本或存储库中。
delete (del, remove, rm) 从版本控制中删除文件和目录。
diff (di) 显示本地更改或两个版本或路径之间的差异。
export 创建一个未版本化的树副本。
help (?, h)
import 将未版本控制的文件或树提交到存储库中。
info 显示有关本地或远程项目的信息。
list (ls) 列出存储库中的目录条目。
lock 锁定存储库中的工作副本路径或URL,其他用户无法对其进行更改。
log 显示一组修订和/或路径的日志消息。
merge 将更改合并到工作副本中。
mergeinfo 显示合并相关信息。
mkdir 在版本控制下创建一个新目录。
move (mv, rename, ren) 移动(重命名)工作副本或存储库中的项目。
patch 将补丁应用于工作副本。
propdel (pdel, pd) 从文件、目录或版本中移除一个属性。
propedit (pedit, pe) 使用外部编辑器编辑属性。
propget (pget, pg) 打印文件、目录或版本的属性值。
proplist (plist, pl) 列出文件、目录或版本的所有属性。
propset (pset, ps) 设置文件、目录或版本的属性值。
relocate 重定位工作副本以指向不同的存储库根URL。
resolve 解决工作副本文件或目录中的冲突。
resolved 删除工作副本文件或目录中的'冲突'状态。
revert 恢复原始工作副本状态(撤消本地更改)。
status (stat, st) 打印工作副本文件和目录的状态。
switch (sw) 将工作副本更新到同一存储库中的其他URL。
unlock 解锁工作路径或URL。
update (up) 将存储库中的更改导入工作副本。
upgrade 升级工作副本的元数据存储格式。
Subversion is a tool for version control.
For additional information, see http://subversion.apache.org/
几个常用命令开关:
- 版本
-r [--revision] ARG
- 详细的
-v [--verbose]
- 简要的
-q [--quiet]
- 强制
--force
- 目录递归
-R [--recursive]
- 操作日志信息
-m [--message] ARG
- 附录 E. 命令行交叉索引
add: Put files and directories under version control, scheduling
them for addition to repository. They will be added in next commit.
usage: add PATH...
Valid options:
--targets ARG : pass contents of file ARG as additional args
-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
--no-ignore : disregard default and svn:ignore and
svn:global-ignores property ignores
--auto-props : enable automatic properties
--no-auto-props : disable automatic properties
--parents : add intermediate parents
auth: Manage cached authentication credentials.
usage: 1. svn auth [PATTERN ...]
usage: 2. svn auth --remove PATTERN [PATTERN ...]
With no arguments, list all cached authentication credentials.
Authentication credentials include usernames, passwords,
SSL certificates, and SSL client-certificate passphrases.
If PATTERN is specified, only list credentials with attributes matching one
or more patterns. With the --remove option, remove cached authentication
credentials matching one or more patterns.
If more than one pattern is specified credentials are considered only they
match all specified patterns. Patterns are matched case-sensitively and may
contain glob wildcards:
? matches any single character
* matches a sequence of arbitrary characters
[abc] matches any of the characters listed inside the brackets
Note that wildcards will usually need to be quoted or escaped on the
command line because many command shells will interfere by trying to
expand them.
Valid options:
--remove : remove matching authentication credentials
--show-passwords : show cached passwords
blame (praise, annotate, ann): Show when each line of a file was last (or
next) changed.
usage: blame [-rM:N] TARGET[@REV]...
Annotate each line of a file with the revision number and author of the
last change (or optionally the next change) to that line.
With no revision range (same as -r0:REV), or with '-r M:N' where M < N,
annotate each line that is present in revision N of the file, with
the last revision at or before rN that changed or added the line,
looking back no further than rM.
With a reverse revision range '-r M:N' where M > N,
annotate each line that is present in revision N of the file, with
the next revision after rN that changed or deleted the line,
looking forward no further than rM.
If specified, REV determines in which revision the target is first
looked up.
Write the annotated result to standard output.
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
-v [--verbose] : print extra information
-g [--use-merge-history] : use/display additional information from merge
history
--incremental : give output suitable for concatenation
--xml : output in XML
-x [--extensions] ARG : Specify differencing options for external diff or
internal diff or blame. Default: '-u'. Options are
separated by spaces. Internal diff and blame take:
-u, --unified: Show 3 lines of unified context
-b, --ignore-space-change: Ignore changes in
amount of white space
-w, --ignore-all-space: Ignore all white space
--ignore-eol-style: Ignore changes in EOL style
-U ARG, --context ARG: Show ARG lines of context
-p, --show-c-function: Show C function name
--force : force operation to run
cat: Output the content of specified files or URLs.
usage: cat TARGET[@REV]...
If specified, REV determines in which revision the target is first
looked up.
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
--ignore-keywords : don't expand keywords
changelist (cl): Associate (or dissociate) changelist CLNAME with the named files.
usage: 1. changelist CLNAME PATH...
2. changelist --remove PATH...
Valid options:
-q [--quiet] : print nothing, or only summary information
-R [--recursive] : descend recursively, same as --depth=infinity
--depth ARG : limit operation by depth ARG ('empty', 'files',
'immediates', or 'infinity')
--remove : remove changelist association
--targets ARG : pass contents of file ARG as additional args
--changelist [--cl] ARG : operate only on members of changelist ARG
checkout (co): Check out a working copy from a repository.
usage: checkout URL[@REV]... [PATH]
If specified, REV determines in which revision the URL is first
looked up.
If PATH is omitted, the basename of the URL will be used as
the destination. If multiple URLs are given each will be checked
out into a sub-directory of PATH, with the name of the sub-directory
being the basename of the URL.
If --force is used, unversioned obstructing paths in the working
copy destination do not automatically cause the check out to fail.
If the obstructing path is the same type (file or directory) as the
corresponding path in the repository it becomes versioned but its
contents are left 'as-is' in the working copy. This means that an
obstructing directory's unversioned children may also obstruct and
become versioned. For files, any content differences between the
obstruction and the repository are treated like a local modification
to the working copy. All properties from the repository are applied
to the obstructing path.
See also 'svn help update' for a list of possible characters
reporting the action taken.
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
-q [--quiet] : print nothing, or only summary information
-N [--non-recursive] : obsolete; try --depth=files or --depth=immediates
--depth ARG : limit operation by depth ARG ('empty', 'files',
'immediates', or 'infinity')
--force : force operation to run
--ignore-externals : ignore externals definitions
cleanup: Recursively clean up the working copy, removing write locks, resuming
unfinished operations, etc.
usage: cleanup [WCPATH...]
By default, finish any unfinished business in the working copy at WCPATH,
and remove write locks (shown as 'L' by the 'svn status' command) from
the working copy. Usually, this is only necessary if a Subversion client
has crashed while using the working copy, leaving it in an unusable state.
WARNING: There is no mechanism that will protect write locks still
being used by other Subversion clients. Running this command
while another client is using the working copy can corrupt
the working copy beyond repair!
If the --remove-unversioned option or the --remove-ignored option
is given, remove any unversioned or ignored items within WCPATH.
To prevent accidental working copy corruption, unversioned or ignored
items can only be removed if the working copy is not already locked
for writing by another Subversion client.
Note that the 'svn status' command shows unversioned items as '?',
and ignored items as 'I' if the --no-ignore option is given to it.
Valid options:
--diff3-cmd ARG : use ARG as merge command
--remove-unversioned : remove unversioned items
--remove-ignored : remove ignored items
--include-externals : also operate on externals defined by
svn:externals properties
-q [--quiet] : print nothing, or only summary information
commit (ci): Send changes from your working copy to the repository.
usage: commit [PATH...]
A log message must be provided, but it can be empty. If it is not
given by a --message or --file option, an editor will be started.
If any targets are (or contain) locked items, those will be
unlocked after a successful commit.
If --include-externals is given, also commit file and directory
externals reached by recursion. Do not commit externals with a
fixed revision.
Valid options:
-q [--quiet] : print nothing, or only summary information
-N [--non-recursive] : obsolete; try --depth=files or --depth=immediates
--depth ARG : limit operation by depth ARG ('empty', 'files',
'immediates', or 'infinity')
--targets ARG : pass contents of file ARG as additional args
--no-unlock : don't unlock the targets
-m [--message] ARG : specify log message ARG
-F [--file] ARG : read log message from file ARG
--force-log : force validity of log message source
--editor-cmd ARG : use ARG as external editor
--encoding ARG : treat value as being in charset encoding ARG
--with-revprop ARG : set revision property ARG in new revision
using the name[=value] format
--changelist [--cl] ARG : operate only on members of changelist ARG
--keep-changelists : don't delete changelists after commit
--include-externals : also operate on externals defined by
svn:externals properties
copy (cp): Copy files and directories in a working copy or repository.
usage: copy SRC[@REV]... DST
SRC and DST can each be either a working copy (WC) path or URL:
WC -> WC: copy and schedule for addition (with history)
WC -> URL: immediately commit a copy of WC to URL
URL -> WC: check out URL into WC, schedule for addition
URL -> URL: complete server-side copy; used to branch and tag
All the SRCs must be of the same type. When copying multiple sources,
they will be added as children of DST, which must be a directory.
WARNING: For compatibility with previous versions of Subversion,
copies performed using two working copy paths (WC -> WC) will not
contact the repository. As such, they may not, by default, be able
to propagate merge tracking information from the source of the copy
to the destination.
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
-q [--quiet] : print nothing, or only summary information
--ignore-externals : ignore externals definitions
--parents : make intermediate directories
-m [--message] ARG : specify log message ARG
-F [--file] ARG : read log message from file ARG
--force-log : force validity of log message source
--editor-cmd ARG : use ARG as external editor
--encoding ARG : treat value as being in charset encoding ARG
--with-revprop ARG : set revision property ARG in new revision
using the name[=value] format
--pin-externals : pin externals with no explicit revision to their
current revision (recommended when tagging)
delete (del, remove, rm): Remove files and directories from version control.
usage: 1. delete PATH...
2. delete URL...
1. Each item specified by a PATH is scheduled for deletion upon
the next commit. Files, and directories that have not been
committed, are immediately removed from the working copy
unless the --keep-local option is given.
PATHs that are, or contain, unversioned or modified items will
not be removed unless the --force or --keep-local option is given.
2. Each item specified by a URL is deleted from the repository
via an immediate commit.
Valid options:
--force : force operation to run
-q [--quiet] : print nothing, or only summary information
--targets ARG : pass contents of file ARG as additional args
-m [--message] ARG : specify log message ARG
-F [--file] ARG : read log message from file ARG
--force-log : force validity of log message source
--editor-cmd ARG : use ARG as external editor
--encoding ARG : treat value as being in charset encoding ARG
--with-revprop ARG : set revision property ARG in new revision
using the name[=value] format
--keep-local : keep path in working copy
diff (di): Display local changes or differences between two revisions or paths.
usage: 1. diff
2. diff [-c M | -r N[:M]] [TARGET[@REV]...]
3. diff [-r N[:M]] --old=OLD-TGT[@OLDREV] [--new=NEW-TGT[@NEWREV]] \
[PATH...]
4. diff OLD-URL[@OLDREV] NEW-URL[@NEWREV]
5. diff OLD-URL[@OLDREV] NEW-PATH[@NEWREV]
6. diff OLD-PATH[@OLDREV] NEW-URL[@NEWREV]
1. Use just 'svn diff' to display local modifications in a working copy.
2. Display the changes made to TARGETs as they are seen in REV between
two revisions. TARGETs may be all working copy paths or all URLs.
If TARGETs are working copy paths, N defaults to BASE and M to the
working copy; if URLs, N must be specified and M defaults to HEAD.
The '-c M' option is equivalent to '-r N:M' where N = M-1.
Using '-c -M' does the reverse: '-r M:N' where N = M-1.
3. Display the differences between OLD-TGT as it was seen in OLDREV and
NEW-TGT as it was seen in NEWREV. PATHs, if given, are relative to
OLD-TGT and NEW-TGT and restrict the output to differences for those
paths. OLD-TGT and NEW-TGT may be working copy paths or URL[@REV].
NEW-TGT defaults to OLD-TGT if not specified. -r N makes OLDREV default
to N, -r N:M makes OLDREV default to N and NEWREV default to M.
If OLDREV or NEWREV are not specified, they default to WORKING for
working copy targets and to HEAD for URL targets.
Either or both OLD-TGT and NEW-TGT may also be paths to unversioned
targets. Revisions cannot be specified for unversioned targets.
Both targets must be of the same node kind (file or directory).
Diffing unversioned targets against URL targets is not supported.
4. Shorthand for 'svn diff --old=OLD-URL[@OLDREV] --new=NEW-URL[@NEWREV]'
5. Shorthand for 'svn diff --old=OLD-URL[@OLDREV] --new=NEW-PATH[@NEWREV]'
6. Shorthand for 'svn diff --old=OLD-PATH[@OLDREV] --new=NEW-URL[@NEWREV]'
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
If ARG is of the form ARG1-ARG2 then this is like
ARG1:ARG2, where ARG1 is inclusive
--old ARG : use ARG as the older target
--new ARG : use ARG as the newer target
-N [--non-recursive] : obsolete; try --depth=files or --depth=immediates
--depth ARG : limit operation by depth ARG ('empty', 'files',
'immediates', or 'infinity')
--diff-cmd ARG : use ARG as diff command
--internal-diff : override diff-cmd specified in config file
-x [--extensions] ARG : Specify differencing options for external diff or
internal diff or blame. Default: '-u'. Options are
separated by spaces. Internal diff and blame take:
-u, --unified: Show 3 lines of unified context
-b, --ignore-space-change: Ignore changes in
amount of white space
-w, --ignore-all-space: Ignore all white space
--ignore-eol-style: Ignore changes in EOL style
-U ARG, --context ARG: Show ARG lines of context
-p, --show-c-function: Show C function name
--no-diff-added : do not print differences for added files
--no-diff-deleted : do not print differences for deleted files
--ignore-properties : ignore properties during the operation
--properties-only : show only properties during the operation
--show-copies-as-adds : don't diff copied or moved files with their source
--notice-ancestry : diff unrelated nodes as delete and add
--summarize : show a summary of the results
--changelist [--cl] ARG : operate only on members of changelist ARG
--force : force operation to run
--xml : output in XML
--git : use git's extended diff format
--patch-compatible : generate diff suitable for generic third-party
patch tools; currently the same as
--show-copies-as-adds --ignore-properties
export: Create an unversioned copy of a tree.
usage: 1. export [-r REV] URL[@PEGREV] [PATH]
2. export [-r REV] PATH1[@PEGREV] [PATH2]
1. Exports a clean directory tree from the repository specified by
URL, at revision REV if it is given, otherwise at HEAD, into
PATH. If PATH is omitted, the last component of the URL is used
for the local directory name.
2. Exports a clean directory tree from the working copy specified by
PATH1, at revision REV if it is given, otherwise at WORKING, into
PATH2. If PATH2 is omitted, the last component of the PATH1 is used
for the local directory name. If REV is not specified, all local
changes will be preserved. Files not under version control will
not be copied.
If specified, PEGREV determines in which revision the target is first
looked up.
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
-q [--quiet] : print nothing, or only summary information
-N [--non-recursive] : obsolete; try --depth=files or --depth=immediates
--depth ARG : limit operation by depth ARG ('empty', 'files',
'immediates', or 'infinity')
--force : force operation to run
--native-eol ARG : use a different EOL marker than the standard
system marker for files with the svn:eol-style
property set to 'native'.
ARG may be one of 'LF', 'CR', 'CRLF'
--ignore-externals : ignore externals definitions
--ignore-keywords : don't expand keywords
import: Commit an unversioned file or tree into the repository.
usage: import [PATH] URL
Recursively commit a copy of PATH to URL.
If PATH is omitted '.' is assumed.
Parent directories are created as necessary in the repository.
If PATH is a directory, the contents of the directory are added
directly under URL.
Unversionable items such as device files and pipes are ignored
if --force is specified.
Valid options:
-q [--quiet] : print nothing, or only summary information
-N [--non-recursive] : obsolete; try --depth=files or --depth=immediates
--depth ARG : limit operation by depth ARG ('empty', 'files',
'immediates', or 'infinity')
--auto-props : enable automatic properties
--force : force operation to run
--no-auto-props : disable automatic properties
-m [--message] ARG : specify log message ARG
-F [--file] ARG : read log message from file ARG
--force-log : force validity of log message source
--editor-cmd ARG : use ARG as external editor
--encoding ARG : treat value as being in charset encoding ARG
--with-revprop ARG : set revision property ARG in new revision
using the name[=value] format
--no-ignore : disregard default and svn:ignore and
svn:global-ignores property ignores
info: Display information about a local or remote item.
usage: info [TARGET[@REV]...]
Print information about each TARGET (default: '.').
TARGET may be either a working-copy path or URL. If specified, REV
determines in which revision the target is first looked up.
With --show-item, print only the value of one item of information
about TARGET. One of the following items can be selected:
kind the kind of TARGET
url the URL of TARGET in the repository
relative-url the repository-relative URL
repos-root-url the repository root URL
repos-uuid the repository UUID
revision the revision of TARGET (defaults to BASE
for working copy paths and HEAD for URLs)
last-changed-revision the most recent revision in which TARGET
was changed
last-changed-date the date of the last-changed revision
last-changed-author the author of the last-changed revision
wc-root the root of TARGET's working copy
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
-R [--recursive] : descend recursively, same as --depth=infinity
--depth ARG : limit operation by depth ARG ('empty', 'files',
'immediates', or 'infinity')
--targets ARG : pass contents of file ARG as additional args
--incremental : give output suitable for concatenation
--xml : output in XML
--changelist [--cl] ARG : operate only on members of changelist ARG
--include-externals : also operate on externals defined by
svn:externals properties
--show-item ARG : print only the item identified by ARG ('kind',
'url', 'relative-url', 'repos-root-url',
'repos-uuid', 'revision', 'last-changed-revision',
'last-changed-date', 'last-changed-author',
'wc-root')
--no-newline : do not output the trailing newline
list (ls): List directory entries in the repository.
usage: list [TARGET[@REV]...]
List each TARGET file and the contents of each TARGET directory as
they exist in the repository. If TARGET is a working copy path, the
corresponding repository URL will be used. If specified, REV determines
in which revision the target is first looked up.
The default TARGET is '.', meaning the repository URL of the current
working directory.
With --verbose, the following fields will be shown for each item:
Revision number of the last commit
Author of the last commit
If locked, the letter 'O'. (Use 'svn info URL' to see details)
Size (in bytes)
Date and time of the last commit
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
-v [--verbose] : print extra information
-R [--recursive] : descend recursively, same as --depth=infinity
--depth ARG : limit operation by depth ARG ('empty', 'files',
'immediates', or 'infinity')
--incremental : give output suitable for concatenation
--xml : output in XML
--include-externals : also operate on externals defined by
svn:externals properties
lock: Lock working copy paths or URLs in the repository, so that
no other user can commit changes to them.
usage: lock TARGET...
Use --force to steal the lock from another user or working copy.
Valid options:
--targets ARG : pass contents of file ARG as additional args
-m [--message] ARG : specify lock comment ARG
-F [--file] ARG : read lock comment from file ARG
--force-log : force validity of lock comment source
--encoding ARG : treat value as being in charset encoding ARG
--force : force operation to run
log: Show the log messages for a set of revision(s) and/or path(s).
usage: 1. log [PATH][@REV]
2. log URL[@REV] [PATH...]
1. Print the log messages for the URL corresponding to PATH
(default: '.'). If specified, REV is the revision in which the
URL is first looked up, and the default revision range is REV:1.
If REV is not specified, the default revision range is BASE:1,
since the URL might not exist in the HEAD revision.
2. Print the log messages for the PATHs (default: '.') under URL.
If specified, REV is the revision in which the URL is first
looked up, and the default revision range is REV:1; otherwise,
the URL is looked up in HEAD, and the default revision range is
HEAD:1.
Multiple '-c' or '-r' options may be specified (but not a
combination of '-c' and '-r' options), and mixing of forward and
reverse ranges is allowed.
With -v, also print all affected paths with each log message.
With -q, don't print the log message body itself (note that this is
compatible with -v).
Each log message is printed just once, even if more than one of the
affected paths for that revision were explicitly requested. Logs
follow copy history by default. Use --stop-on-copy to disable this
behavior, which can be useful for determining branchpoints.
The --depth option is only valid in combination with the --diff option
and limits the scope of the displayed diff to the specified depth.
If the --search option is used, log messages are displayed only if the
provided search pattern matches any of the author, date, log message
text (unless --quiet is used), or, if the --verbose option is also
provided, a changed path.
The search pattern may include "glob syntax" wildcards:
? matches any single character
* matches a sequence of arbitrary characters
[abc] matches any of the characters listed inside the brackets
If multiple --search options are provided, a log message is shown if
it matches any of the provided search patterns. If the --search-and
option is used, that option's argument is combined with the pattern
from the previous --search or --search-and option, and a log message
is shown only if it matches the combined search pattern.
If --limit is used in combination with --search, --limit restricts the
number of log messages searched, rather than restricting the output
to a particular number of matching log messages.
Examples:
Show the latest 5 log messages for the current working copy
directory and display paths changed in each commit:
svn log -l 5 -v
Show the log for bar.c as of revision 42:
svn log bar.c@42
Show log messages and diffs for each commit to foo.c:
svn log --diff http://www.example.com/repo/project/foo.c
(Because the above command uses a full URL it does not require
a working copy.)
Show log messages for the children foo.c and bar.c of the directory
'/trunk' as it appeared in revision 50, using the ^/ URL shortcut:
svn log ^/trunk@50 foo.c bar.c
Show the log messages for any incoming changes to foo.c during the
next 'svn update':
svn log -r BASE:HEAD foo.c
Show the log message for the revision in which /branches/foo
was created:
svn log --stop-on-copy --limit 1 -r0:HEAD ^/branches/foo
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 in revision ARG
-q [--quiet] : do not print the log message
-v [--verbose] : also print all affected paths
-g [--use-merge-history] : use/display additional information from merge
history
--targets ARG : pass contents of file ARG as additional args
--stop-on-copy : do not cross copies while traversing history
--incremental : give output suitable for concatenation
--xml : output in XML
-l [--limit] ARG : maximum number of log entries
--with-all-revprops : retrieve all revision properties
--with-no-revprops : retrieve no revision properties
--with-revprop ARG : retrieve revision property ARG
--depth ARG : limit operation by depth ARG ('empty', 'files',
'immediates', or 'infinity')
--diff : produce diff output
--diff-cmd ARG : use ARG as diff command
--internal-diff : override diff-cmd specified in config file
-x [--extensions] ARG : Specify differencing options for external diff or
internal diff or blame. Default: '-u'. Options are
separated by spaces. Internal diff and blame take:
-u, --unified: Show 3 lines of unified context
-b, --ignore-space-change: Ignore changes in
amount of white space
-w, --ignore-all-space: Ignore all white space
--ignore-eol-style: Ignore changes in EOL style
-U ARG, --context ARG: Show ARG lines of context
-p, --show-c-function: Show C function name
--search ARG : use ARG as search pattern (glob syntax)
--search-and ARG : combine ARG with the previous search pattern
merge: Merge changes into a working copy.
usage: 1. merge SOURCE[@REV] [TARGET_WCPATH]
(the 'complete' merge)
2. merge [-c M[,N...] | -r N:M ...] SOURCE[@REV] [TARGET_WCPATH]
(the 'cherry-pick' merge)
3. merge SOURCE1[@REV1] SOURCE2[@REV2] [TARGET_WCPATH]
(the '2-URL' merge)
1. This form, with one source path and no revision range, is called
a 'complete' merge:
svn merge SOURCE[@REV] [TARGET_WCPATH]
The complete merge is used for the 'sync' and 'reintegrate' merges
in the 'feature branch' pattern described below. It finds all the
changes on the source branch that have not already been merged to the
target branch, and merges them into the working copy. Merge tracking
is used to know which changes have already been merged.
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.)
SOURCE is usually a URL. The optional '@REV' specifies both the peg
revision of the URL and the latest revision that will be considered
for merging; 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 generally
assumed. There are some special cases:
- If SOURCE is a URL:
- If the basename of the URL and the basename of '.' are the
same, then the differences are applied to '.'. Otherwise,
if a file with the same basename as that of the URL is found
within '.', then the differences are applied to that file.
In all other cases, the target defaults to '.'.
- If SOURCE is a working copy path:
- If the source is a file, then differences are applied to that
file (useful for reverse-merging earlier changes). Otherwise,
if the source is a directory, then the target defaults to '.'.
In normal usage the working copy should be up to date, at a single
revision, with no local modifications and no switched subtrees.
- The 'Feature Branch' Merging Pattern -
In this commonly used work flow, known also as the 'development
branch' pattern, a developer creates a branch and commits a series of
changes that implement a new feature. The developer periodically
merges all the latest changes from the parent branch so as to keep the
development branch up to date with those changes. When the feature is
complete, the developer performs a merge from the feature branch to
the parent branch to re-integrate the changes.
parent --+----------o------o-o-------------o--
\ \ \ /
\ merge merge merge
\ \ \ /
feature +--o-o-------o----o-o----o-------
A merge from the parent branch to the feature branch is called a
'sync' or 'catch-up' merge, and a merge from the feature branch to the
parent branch is called a 'reintegrate' merge.
- Sync Merge Example -
............
. .
trunk --+------------L--------------R------
\ \
\ |
\ v
feature +------------------------o-----
r100 r200
Subversion will locate all the changes on 'trunk' that have not yet
been merged into the 'feature' branch. In this case that is a single
range, r100:200. In the diagram above, L marks the left side (trunk@100)
and R marks the right side (trunk@200) of the merge source. The
difference between L and R will be applied to the target working copy
path. In this case, the working copy is a clean checkout of the entire
'feature' branch.
To perform this sync merge, have a clean working copy of the feature
branch and run the following command in its top-level directory:
svn merge ^/trunk
Note that the merge is now only in your local working copy and still
needs to be committed to the repository so that it can be seen by
others. You can review the changes and you may have to resolve
conflicts before you commit the merge.
- Reintegrate Merge Example -
The feature branch was last synced with trunk up to revision X. So the
difference between trunk@X and feature@HEAD contains the complete set
of changes that implement the feature, and no other changes. These
changes are applied to trunk.
rW rX
trunk ------+--------------------L------------------o
\ . ^
\ ............. /
\ . /
feature +--------------------------------R
In the diagram above, L marks the left side (trunk@X) and R marks the
right side (feature@HEAD) of the merge. The difference between the
left and right side is merged into trunk, the target.
To perform the merge, have a clean working copy of trunk and run the
following command in its top-level directory:
svn merge ^/feature
To prevent unnecessary merge conflicts, a reintegrate merge requires
that TARGET_WCPATH is not a mixed-revision working copy, has no local
modifications, and has no switched subtrees.
A reintegrate merge also requires that the source branch is coherently
synced with the target -- in the above example, this means that all
revisions between the branch point W and the last merged revision X
are merged to the feature branch, so that there are no unmerged
revisions in-between.
2. 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 generally
assumed. The special cases noted above in the 'complete' merge form
also apply here.
The revision ranges to be merged are specified by the '-r' and/or '-c'
options. '-r N:M' refers to the difference in the history of the
source branch between revisions N and M. You can use '-c M' to merge
single revisions: '-c M' is equivalent to '-r <M-1>:M'. Each such
difference is applied to TARGET_WCPATH.
If the mergeinfo in TARGET_WCPATH indicates that revisions within the
range were already merged, changes made in those revisions are not
merged again. If needed, the range is broken into multiple sub-ranges,
and each sub-range is merged separately.
A 'reverse range' can be used to undo changes. For example, when
source and target refer to the same branch, a previously committed
revision can be 'undone'. In a reverse range, N is greater than M in
'-r N:M', or the '-c' option is used with a negative number: '-c -M'
is equivalent to '-r M:<M-1>'. Undoing changes like this is also known
as performing a 'reverse merge'.
Multiple '-c' and/or '-r' options may be specified and mixing of
forward and reverse ranges is allowed.
- Cherry-pick Merge Example -
A bug has been fixed on trunk in revision 50. This fix needs to
be merged from trunk onto the release branch.
1.x-release +-----------------------o-----
/ ^
/ |
/ |
trunk ------+--------------------------LR-----
r50
In the above diagram, L marks the left side (trunk@49) and R marks the
right side (trunk@50) of the merge. The difference between the left
and right side is applied to the target working copy path.
Note that the difference between revision 49 and 50 is exactly those
changes that were committed in revision 50, not including changes
committed in revision 49.
To perform the merge, have a clean working copy of the release branch
and run the following command in its top-level directory; remember
that the default target is '.':
svn merge -c50 ^/trunk
You can also cherry-pick several revisions and/or revision ranges:
svn merge -c50,54,60 -r65:68 ^/trunk
3. This form is called a '2-URL merge':
svn merge SOURCE1[@REV1] SOURCE2[@REV2] [TARGET_WCPATH]
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.
Two source URLs are specified, identifying two trees on the same
branch or on different branches. The trees are compared and the
difference from SOURCE1@REV1 to SOURCE2@REV2 is applied to the
working copy of the target branch at TARGET_WCPATH. The target
branch may be the same as one or both sources, or different again.
The three branches involved can be completely unrelated.
TARGET_WCPATH is a working copy path; if omitted, '.' is generally
assumed. The special cases noted above in the 'complete' merge form
also apply here.
SOURCE1 and/or SOURCE2 can also be specified as a working copy path,
in which case the merge source URL is derived from the working copy.
- 2-URL Merge Example -
Two features have been developed on separate branches called 'foo' and
'bar'. It has since become clear that 'bar' should be combined with
the 'foo' branch for further development before reintegration.
Although both feature branches originate from trunk, they are not
directly related -- one is not a direct copy of the other. A 2-URL
merge is necessary.
The 'bar' branch has been synced with trunk up to revision 500.
(If this revision number is not known, it can be located using the
'svn log' and/or 'svn mergeinfo' commands.)
The difference between trunk@500 and bar@HEAD contains the complete
set of changes related to feature 'bar', and no other changes. These
changes are applied to the 'foo' branch.
foo +-----------------------------------o
/ ^
/ /
/ r500 /
trunk ------+------+-----------------L---------> /
\ . /
\ ............ /
\ . /
bar +-----------------------------------R
In the diagram above, L marks the left side (trunk@500) and R marks
the right side (bar@HEAD) of the merge. The difference between the
left and right side is applied to the target working copy path, in
this case a working copy of the 'foo' branch.
To perform the merge, have a clean working copy of the 'foo' branch
and run the following command in its top-level directory:
svn merge ^/trunk@500 ^/bar
The exact changes applied by a 2-URL merge can be previewed with svn's
diff command, which is a good idea to verify if you do not have the
luxury of a clean working copy to merge to. In this case:
svn diff ^/trunk@500 ^/bar@HEAD
The following applies to all types of merges:
To prevent unnecessary merge conflicts, svn merge requires that
TARGET_WCPATH is not a mixed-revision working copy. Running 'svn update'
before starting a merge ensures that all items in the working copy are
based on the same revision.
If possible, you should have no local modifications in the merge's target
working copy prior to the merge, to keep things simpler. It will be
easier to revert the merge and to understand the branch's history.
Switched sub-paths should also be avoided during merging, as they may
cause incomplete merges and create subtree mergeinfo.
For each merged item a line will be printed with characters reporting the
action taken. These characters have the following meaning:
A Added
D Deleted
U Updated
C Conflict
G Merged
E Existed
R Replaced
Characters in the first column report about the item itself.
Characters in the second column report about properties of the item.
A 'C' in the third column indicates a tree conflict, while a 'C' in
the first and second columns indicate textual conflicts in files
and in property values, respectively.
- 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.
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
If ARG is of the form ARG1-ARG2 then this is like
ARG1:ARG2, where ARG1 is inclusive
-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 deletions even if deleted contents don't match
--dry-run : try operation but make no changes
--diff3-cmd ARG : use ARG as merge command
--record-only : merge only mergeinfo differences
-x [--extensions] ARG : Specify differencing options for external diff or
internal diff or blame. Default: '-u'. Options are
separated by spaces. Internal diff and blame take:
-u, --unified: Show 3 lines of unified context
-b, --ignore-space-change: Ignore changes in
amount of white space
-w, --ignore-all-space: Ignore all white space
--ignore-eol-style: Ignore changes in EOL style
-U ARG, --context ARG: Show ARG lines of context
-p, --show-c-function: Show C function name
--ignore-ancestry : disable merge tracking; diff nodes as if related
--accept ARG : specify automatic conflict resolution action
('postpone', 'working', 'base', 'mine-conflict',
'theirs-conflict', 'mine-full', 'theirs-full',
'edit', 'launch')
(shorthand: 'p', 'mc', 'tc', 'mf', 'tf', 'e', 'l')
--reintegrate : deprecated
--allow-mixed-revisions : Allow operation on mixed-revision working copy.
Use of this option is not recommended!
Please run 'svn update' instead.
-v [--verbose] : print extra information
mergeinfo: Display merge-related information.
usage: 1. mergeinfo SOURCE[@REV] [TARGET[@REV]]
2. mergeinfo --show-revs=WHICH SOURCE[@REV] [TARGET[@REV]]
1. Summarize the history of merging between SOURCE and TARGET. The graph
shows, from left to right:
the youngest common ancestor of the branches;
the latest full merge in either direction, and thus the common base
that will be used for the next complete merge;
the repository path and revision number of the tip of each branch.
2. Print the revision numbers on SOURCE that have been merged to TARGET
(with --show-revs=merged), or that have not been merged to TARGET
(with --show-revs=eligible). Print only revisions in which there was
at least one change in SOURCE.
If --revision (-r) is provided, filter the displayed information to
show only that which is associated with the revisions within the
specified range. Revision numbers, dates, and the 'HEAD' keyword are
valid range values.
SOURCE and TARGET are the source and target branch URLs, respectively.
(If a WC path is given, the corresponding base URL is used.) The default
TARGET is the current working directory ('.'). REV specifies the revision
to be considered the tip of the branch; the default for SOURCE is HEAD,
and the default for TARGET is HEAD for a URL or BASE for a WC path.
The depth can be 'empty' or 'infinity'; the default is 'empty'.
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
-R [--recursive] : descend recursively, same as --depth=infinity
-q [--quiet] : print nothing, or only summary information
-v [--verbose] : print extra information
--depth ARG : limit operation by depth ARG ('empty', 'files',
'immediates', or 'infinity')
--show-revs ARG : specify which collection of revisions to display
('merged', 'eligible')
--log : show revision log message, author and date
--incremental : give output suitable for concatenation
mkdir: Create a new directory under version control.
usage: 1. mkdir PATH...
2. mkdir URL...
Create version controlled directories.
1. Each directory specified by a working copy PATH is created locally
and scheduled for addition upon the next commit.
2. Each directory specified by a URL is created in the repository via
an immediate commit.
In both cases, all the intermediate directories must already exist,
unless the --parents option is given.
Valid options:
-q [--quiet] : print nothing, or only summary information
--parents : make intermediate directories
-m [--message] ARG : specify log message ARG
-F [--file] ARG : read log message from file ARG
--force-log : force validity of log message source
--editor-cmd ARG : use ARG as external editor
--encoding ARG : treat value as being in charset encoding ARG
--with-revprop ARG : set revision property ARG in new revision
using the name[=value] format
move (mv, rename, ren): Move (rename) an item in a working copy or repository.
usage: move SRC... DST
SRC and DST can both be working copy (WC) paths or URLs:
WC -> WC: move an item in a working copy, as a local change to
be committed later (with or without further changes)
URL -> URL: move an item in the repository directly, immediately
creating a new revision in the repository
All the SRCs must be of the same type. When moving multiple sources,
they will be added as children of DST, which must be a directory.
SRC and DST of WC -> WC moves must be committed in the same revision.
Furthermore, WC -> WC moves will refuse to move a mixed-revision subtree.
To avoid unnecessary conflicts, it is recommended to run 'svn update'
to update the subtree to a single revision before moving it.
The --allow-mixed-revisions option is provided for backward compatibility.
The --revision option has no use and is deprecated.
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
-q [--quiet] : print nothing, or only summary information
--force : force operation to run
--parents : make intermediate directories
--allow-mixed-revisions : Allow operation on mixed-revision working copy.
Use of this option is not recommended!
Please run 'svn update' instead.
-m [--message] ARG : specify log message ARG
-F [--file] ARG : read log message from file ARG
--force-log : force validity of log message source
--editor-cmd ARG : use ARG as external editor
--encoding ARG : treat value as being in charset encoding ARG
--with-revprop ARG : set revision property ARG in new revision
using the name[=value] format
patch: Apply a patch to a working copy.
usage: patch PATCHFILE [WCPATH]
Apply a unidiff patch in PATCHFILE to the working copy WCPATH.
If WCPATH is omitted, '.' is assumed.
A unidiff patch suitable for application to a working copy can be
produced with the 'svn diff' command or third-party diffing tools.
Any non-unidiff content of PATCHFILE is ignored, except for Subversion
property diffs as produced by 'svn diff'.
Changes listed in the patch will either be applied or rejected.
If a change does not match at its exact line offset, it may be applied
earlier or later in the file if a match is found elsewhere for the
surrounding lines of context provided by the patch.
A change may also be applied with fuzz, which means that one
or more lines of context are ignored when matching the change.
If no matching context can be found for a change, the change conflicts
and will be written to a reject file with the extension .svnpatch.rej.
For each patched file a line will be printed with characters reporting
the action taken. These characters have the following meaning:
A Added
D Deleted
U Updated
C Conflict
G Merged (with local uncommitted changes)
Changes applied with an offset or fuzz are reported on lines starting
with the '>' symbol. You should review such changes carefully.
If the patch removes all content from a file, that file is scheduled
for deletion. If the patch creates a new file, that file is scheduled
for addition. Use 'svn revert' to undo deletions and additions you
do not agree with.
Hint: If the patch file was created with Subversion, it will contain
the number of a revision N the patch will cleanly apply to
(look for lines like '--- foo/bar.txt (revision N)').
To avoid rejects, first update to the revision N using
'svn update -r N', apply the patch, and then update back to the
HEAD revision. This way, conflicts can be resolved interactively.
Valid options:
-q [--quiet] : print nothing, or only summary information
--dry-run : try operation but make no changes
--strip ARG : number of leading path components to strip from
paths parsed from the patch file. --strip 0
is the default and leaves paths unmodified.
--strip 1 would change the path
'doc/fudge/crunchy.html' to 'fudge/crunchy.html'.
--strip 2 would leave just 'crunchy.html'
The expected component separator is '/' on all
platforms. A leading '/' counts as one component.
--reverse-diff : apply the unidiff in reverse
--ignore-whitespace : ignore whitespace during pattern matching
propdel (pdel, pd): Remove a property from files, dirs, or revisions.
usage: 1. propdel PROPNAME [PATH...]
2. propdel PROPNAME --revprop -r REV [TARGET]
1. Removes versioned props in working copy.
2. Removes unversioned remote prop on repos revision.
TARGET only determines which repository to access.
See 'svn help propset' for descriptions of the svn:* special properties.
Valid options:
-q [--quiet] : print nothing, or only summary information
-R [--recursive] : descend recursively, same as --depth=infinity
--depth ARG : limit operation by depth ARG ('empty', 'files',
'immediates', or 'infinity')
-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
--revprop : operate on a revision property (use with -r)
--changelist [--cl] ARG : operate only on members of changelist ARG
propedit (pedit, pe): Edit a property with an external editor.
usage: 1. propedit PROPNAME TARGET...
2. propedit PROPNAME --revprop -r REV [TARGET]
1. Edits versioned prop in working copy or repository.
2. Edits unversioned remote prop on repos revision.
TARGET only determines which repository to access.
See 'svn help propset' for descriptions of the svn:* special properties.
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
--revprop : operate on a revision property (use with -r)
-m [--message] ARG : specify log message ARG
-F [--file] ARG : read log message from file ARG
--force-log : force validity of log message source
--editor-cmd ARG : use ARG as external editor
--encoding ARG : treat value as being in charset encoding ARG
--with-revprop ARG : set revision property ARG in new revision
using the name[=value] format
--force : force operation to run
propget (pget, pg): Print the value of a property on files, dirs, or revisions.
usage: 1. propget PROPNAME [TARGET[@REV]...]
2. propget PROPNAME --revprop -r REV [TARGET]
1. Prints versioned props. If specified, REV determines in which
revision the target is first looked up.
2. Prints unversioned remote prop on repos revision.
TARGET only determines which repository to access.
With --verbose, the target path and the property name are printed on
separate lines before each value, like 'svn proplist --verbose'.
Otherwise, if there is more than one TARGET or a depth other than
'empty', the target path is printed on the same line before each value.
By default, an extra newline is printed after the property value so that
the output looks pretty. With a single TARGET, depth 'empty' and without
--show-inherited-props, you can use the --no-newline option to disable this
(useful when redirecting a binary property value to a file, for example).
See 'svn help propset' for descriptions of the svn:* special properties.
Valid options:
-v [--verbose] : print path, name and value on separate lines
-R [--recursive] : descend recursively, same as --depth=infinity
--depth ARG : limit operation by depth ARG ('empty', 'files',
'immediates', or 'infinity')
-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
--revprop : operate on a revision property (use with -r)
--strict : (deprecated; use --no-newline)
--no-newline : do not output the trailing newline
--xml : output in XML
--changelist [--cl] ARG : operate only on members of changelist ARG
--show-inherited-props : retrieve properties set on parents of the target
proplist (plist, pl): List all properties on files, dirs, or revisions.
usage: 1. proplist [TARGET[@REV]...]
2. proplist --revprop -r REV [TARGET]
1. Lists versioned props. If specified, REV determines in which
revision the target is first looked up.
2. Lists unversioned remote props on repos revision.
TARGET only determines which repository to access.
With --verbose, the property values are printed as well, like 'svn propget
--verbose'. With --quiet, the paths are not printed.
See 'svn help propset' for descriptions of the svn:* special properties.
Valid options:
-v [--verbose] : print path, name and value on separate lines
-R [--recursive] : descend recursively, same as --depth=infinity
--depth ARG : limit operation by depth ARG ('empty', 'files',
'immediates', or 'infinity')
-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
-q [--quiet] : don't print the path
--revprop : operate on a revision property (use with -r)
--xml : output in XML
--changelist [--cl] ARG : operate only on members of changelist ARG
--show-inherited-props : retrieve properties set on parents of the target
propset (pset, ps): Set the value of a property on files, dirs, or revisions.
usage: 1. propset PROPNAME PROPVAL PATH...
2. propset PROPNAME --revprop -r REV PROPVAL [TARGET]
1. Changes a versioned file or directory property in a working copy.
2. Changes an unversioned property on a repository revision.
(TARGET only determines which repository to access.)
The value may be provided with the --file option instead of PROPVAL.
Property names starting with 'svn:' are reserved. Subversion recognizes
the following special versioned properties on a file:
svn:keywords - Keywords to be expanded. Valid keywords are:
URL, HeadURL - The URL for the head version of the file.
Author, LastChangedBy - The last person to modify the file.
Date, LastChangedDate - The date/time the file was last modified.
Rev, Revision, - The last revision the file changed.
LastChangedRevision
Id - A compressed summary of the previous four.
Header - Similar to Id but includes the full URL.
Custom keywords can be defined with a format string separated from
the keyword name with '='. Valid format substitutions are:
%a - The author of the revision given by %r.
%b - The basename of the URL of the file.
%d - Short format of the date of the revision given by %r.
%D - Long format of the date of the revision given by %r.
%P - The file's path, relative to the repository root.
%r - The number of the revision which last changed the file.
%R - The URL to the root of the repository.
%u - The URL of the file.
%_ - A space (keyword definitions cannot contain a literal space).
%% - A literal '%'.
%H - Equivalent to %P%_%r%_%d%_%a.
%I - Equivalent to %b%_%r%_%d%_%a.
Example custom keyword definition: MyKeyword=%r%_%a%_%P
Once a custom keyword has been defined for a file, it can be used
within the file like any other keyword: $MyKeyword$
svn:executable - If present, make the file executable. Use
'svn propdel svn:executable PATH...' to clear.
svn:eol-style - One of 'native', 'LF', 'CR', 'CRLF'.
svn:mime-type - The mimetype of the file. Used to determine
whether to merge the file, and how to serve it from Apache.
A mimetype beginning with 'text/' (or an absent mimetype) is
treated as text. Anything else is treated as binary.
svn:needs-lock - If present, indicates that the file should be locked
before it is modified. Makes the working copy file read-only
when it is not locked. Use 'svn propdel svn:needs-lock PATH...'
to clear.
Subversion recognizes the following special versioned properties on a
directory:
svn:ignore - A list of file glob patterns to ignore, one per line.
svn:global-ignores - Like svn:ignore, but inheritable.
svn:auto-props - Automatically set properties on files when they are
added or imported. Contains key-value pairs, one per line, in the format:
PATTERN = PROPNAME=VALUE[;PROPNAME=VALUE ...]
Example (where a literal ';' is escaped by adding another ';'):
*.html = svn:eol-style=native;svn:mime-type=text/html;; charset=UTF8
Applies recursively to all files added or imported under the directory
it is set on. See also [auto-props] in the client configuration file.
svn:externals - A list of module specifiers, one per line, in the
following format similar to the syntax of 'svn checkout':
[-r REV] URL[@PEG] LOCALPATH
Example:
http://example.com/repos/zig foo/bar
The LOCALPATH is relative to the directory having this property.
To pin the external to a known revision, specify the optional REV:
-r25 http://example.com/repos/zig foo/bar
To unambiguously identify an element at a path which may have been
subsequently deleted or renamed, specify the optional PEG revision:
-r25 http://example.com/repos/zig@42 foo/bar
The URL may be a full URL or a relative URL starting with one of:
../ to the parent directory of the extracted external
^/ to the repository root
/ to the server root
// to the URL scheme
^/../ to a sibling repository beneath the same SVNParentPath location
Use of the following format is discouraged but is supported for
interoperability with Subversion 1.4 and earlier clients:
LOCALPATH [-r PEG] URL
The ambiguous format 'relative_path relative_path' is taken as
'relative_url relative_path' with peg revision support.
Lines starting with a '#' character are ignored.
Valid options:
-F [--file] ARG : read property value from file ARG
--encoding ARG : treat value as being in charset encoding ARG
-q [--quiet] : print nothing, or only summary information
-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
--targets ARG : pass contents of file ARG as additional args
-R [--recursive] : descend recursively, same as --depth=infinity
--depth ARG : limit operation by depth ARG ('empty', 'files',
'immediates', or 'infinity')
--revprop : operate on a revision property (use with -r)
--force : force operation to run
--changelist [--cl] ARG : operate only on members of changelist ARG
relocate: Relocate the working copy to point to a different repository root URL.
usage: 1. relocate FROM-PREFIX TO-PREFIX [PATH...]
2. relocate TO-URL [PATH]
Rewrite working copy URL metadata to reflect a syntactic change only.
This is used when a repository's root URL changes (such as a scheme
or hostname change) but your working copy still reflects the same
directory within the same repository.
1. FROM-PREFIX and TO-PREFIX are initial substrings of the working
copy's current and new URLs, respectively. (You may specify the
complete old and new URLs if you wish.) Use 'svn info' to determine
the current working copy URL.
2. TO-URL is the (complete) new repository URL to use for PATH.
Examples:
svn relocate http:// svn:// project1 project2
svn relocate http://www.example.com/repo/project \
svn://svn.example.com/repo/project
Valid options:
--ignore-externals : ignore externals definitions
resolve: Resolve conflicts on working copy files or directories.
usage: resolve [PATH...]
By default, perform interactive conflict resolution on PATH.
In this mode, the command is recursive by default (depth 'infinity').
The --accept=ARG option prevents interactive prompting and forces
conflicts on PATH to be resolved in the manner specified by ARG.
In this mode, the command is not recursive by default (depth 'empty').
Valid options:
--targets ARG : pass contents of file ARG as additional args
-R [--recursive] : descend recursively, same as --depth=infinity
--depth ARG : limit operation by depth ARG ('empty', 'files',
'immediates', or 'infinity')
-q [--quiet] : print nothing, or only summary information
--accept ARG : specify automatic conflict resolution source
('base', 'working', 'mine-conflict',
'theirs-conflict', 'mine-full', 'theirs-full')
resolved: Remove 'conflicted' state on working copy files or directories.
usage: resolved PATH...
Note: this subcommand does not semantically resolve conflicts or
remove conflict markers; it merely removes the conflict-related
artifact files and allows PATH to be committed again. It has been
deprecated in favor of running 'svn resolve --accept working'.
Valid options:
--targets ARG : pass contents of file ARG as additional args
-R [--recursive] : descend recursively, same as --depth=infinity
--depth ARG : limit operation by depth ARG ('empty', 'files',
'immediates', or 'infinity')
-q [--quiet] : print nothing, or only summary information
revert: Restore pristine working copy state (undo local changes).
usage: revert PATH...
Revert changes in the working copy at or within PATH, and remove
conflict markers as well, if any.
This subcommand does not revert already committed changes.
For information about undoing already committed changes, search
the output of 'svn help merge' for 'undo'.
Valid options:
--targets ARG : pass contents of file ARG as additional args
-R [--recursive] : descend recursively, same as --depth=infinity
--depth ARG : limit operation by depth ARG ('empty', 'files',
'immediates', or 'infinity')
-q [--quiet] : print nothing, or only summary information
--changelist [--cl] ARG : operate only on members of changelist ARG
status (stat, st): Print the status of working copy files and directories.
usage: status [PATH...]
With no args, print only locally modified items (no network access).
With -q, print only summary information about locally modified items.
With -u, add working revision and server out-of-date information.
With -v, print full revision information on every item.
The first seven columns in the output are each one character wide:
First column: Says if item was added, deleted, or otherwise changed
' ' no modifications
'A' Added
'C' Conflicted
'D' Deleted
'I' Ignored
'M' Modified
'R' Replaced
'X' an unversioned directory created by an externals definition
'?' item is not under version control
'!' item is missing (removed by non-svn command) or incomplete
'~' versioned item obstructed by some item of a different kind
Second column: Modifications of a file's or directory's properties
' ' no modifications
'C' Conflicted
'M' Modified
Third column: Whether the working copy is locked for writing by
another Subversion client modifying the working copy
' ' not locked for writing
'L' locked for writing
Fourth column: Scheduled commit will create a copy (addition-with-history)
' ' no history scheduled with commit (item was newly added)
'+' history scheduled with commit (item was copied)
Fifth column: Whether the item is switched or a file external
' ' normal
'S' the item has a Switched URL relative to the parent
'X' a versioned file created by an eXternals definition
Sixth column: Whether the item is locked in repository for exclusive commit
(without -u)
' ' not locked by this working copy
'K' locked by this working copy, but lock might be stolen or broken
(with -u)
' ' not locked in repository, not locked by this working copy
'K' locked in repository, lock owned by this working copy
'O' locked in repository, lock owned by another working copy
'T' locked in repository, lock owned by this working copy was stolen
'B' not locked in repository, lock owned by this working copy is broken
Seventh column: Whether the item is the victim of a tree conflict
' ' normal
'C' tree-Conflicted
If the item is a tree conflict victim, an additional line is printed
after the item's status line, explaining the nature of the conflict.
The out-of-date information appears in the ninth column (with -u):
'*' a newer revision exists on the server
' ' the working copy is up to date
Remaining fields are variable width and delimited by spaces:
The working revision (with -u or -v; '-' if the item is copied)
The last committed revision and last committed author (with -v)
The working copy path is always the final field, so it can
include spaces.
The presence of a question mark ('?') where a working revision, last
committed revision, or last committed author was expected indicates
that the information is unknown or irrelevant given the state of the
item (for example, when the item is the result of a copy operation).
The question mark serves as a visual placeholder to facilitate parsing.
Example output:
svn status wc
M wc/bar.c
A + wc/qax.c
svn status -u wc
M 965 wc/bar.c
* 965 wc/foo.c
A + - wc/qax.c
Status against revision: 981
svn status --show-updates --verbose wc
M 965 938 kfogel wc/bar.c
* 965 922 sussman wc/foo.c
A + - 687 joe wc/qax.c
965 687 joe wc/zig.c
Status against revision: 981
svn status
M wc/bar.c
! C wc/qaz.c
> local missing, incoming edit upon update
D wc/qax.c
Valid options:
-u [--show-updates] : display update information
-v [--verbose] : print extra information
-N [--non-recursive] : obsolete; try --depth=files or --depth=immediates
--depth ARG : limit operation by depth ARG ('empty', 'files',
'immediates', or 'infinity')
-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
-q [--quiet] : don't print unversioned items
--no-ignore : disregard default and svn:ignore and
svn:global-ignores property ignores
--incremental : give output suitable for concatenation
--xml : output in XML
--ignore-externals : ignore externals definitions
--changelist [--cl] ARG : operate only on members of changelist ARG
switch (sw): Update the working copy to a different URL within the same repository.
usage: 1. switch URL[@PEGREV] [PATH]
2. switch --relocate FROM-PREFIX TO-PREFIX [PATH...]
1. Update the working copy to mirror a new URL within the repository.
This behavior is similar to 'svn update', and is the way to
move a working copy to a branch or tag within the same repository.
If specified, PEGREV determines in which revision the target is first
looked up.
If --force is used, unversioned obstructing paths in the working
copy do not automatically cause a failure if the switch attempts to
add the same path. If the obstructing path is the same type (file
or directory) as the corresponding path in the repository it becomes
versioned but its contents are left 'as-is' in the working copy.
This means that an obstructing directory's unversioned children may
also obstruct and become versioned. For files, any content differences
between the obstruction and the repository are treated like a local
modification to the working copy. All properties from the repository
are applied to the obstructing path.
Use the --set-depth option to set a new working copy depth on the
targets of this operation.
By default, Subversion will refuse to switch a working copy path to
a new URL with which it shares no common version control ancestry.
Use the '--ignore-ancestry' option to override this sanity check.
2. The '--relocate' option is deprecated. This syntax is equivalent to
'svn relocate FROM-PREFIX TO-PREFIX [PATH]'.
See also 'svn help update' for a list of possible characters
reporting the action taken.
Examples:
svn switch ^/branches/1.x-release
svn switch --relocate http:// svn://
svn switch --relocate http://www.example.com/repo/project \
svn://svn.example.com/repo/project
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
-N [--non-recursive] : obsolete; try --depth=files or --depth=immediates
--depth ARG : limit operation by depth ARG ('empty', 'files',
'immediates', or 'infinity')
--set-depth ARG : set new working copy depth to ARG ('exclude',
'empty', 'files', 'immediates', or 'infinity')
-q [--quiet] : print nothing, or only summary information
--diff3-cmd ARG : use ARG as merge command
--relocate : relocate via URL-rewriting
--ignore-externals : ignore externals definitions
--ignore-ancestry : allow switching to a node with no common ancestor
--force : handle unversioned obstructions as changes
--accept ARG : specify automatic conflict resolution action
('postpone', 'working', 'base', 'mine-conflict',
'theirs-conflict', 'mine-full', 'theirs-full',
'edit', 'launch')
(shorthand: 'p', 'mc', 'tc', 'mf', 'tf', 'e', 'l')
unlock: Unlock working copy paths or URLs.
usage: unlock TARGET...
Use --force to break the lock.
Valid options:
--targets ARG : pass contents of file ARG as additional args
--force : force operation to run
update (up): Bring changes from the repository into the working copy.
usage: update [PATH...]
If no revision is given, bring working copy up-to-date with HEAD rev.
Else synchronize working copy to revision given by -r.
For each updated item a line will be printed with characters reporting
the action taken. These characters have the following meaning:
A Added
D Deleted
U Updated
C Conflict
G Merged
E Existed
R Replaced
Characters in the first column report about the item itself.
Characters in the second column report about properties of the item.
A 'B' in the third column signifies that the lock for the file has
been broken or stolen.
A 'C' in the fourth column indicates a tree conflict, while a 'C' in
the first and second columns indicate textual conflicts in files
and in property values, respectively.
If --force is used, unversioned obstructing paths in the working
copy do not automatically cause a failure if the update attempts to
add the same path. If the obstructing path is the same type (file
or directory) as the corresponding path in the repository it becomes
versioned but its contents are left 'as-is' in the working copy.
This means that an obstructing directory's unversioned children may
also obstruct and become versioned. For files, any content differences
between the obstruction and the repository are treated like a local
modification to the working copy. All properties from the repository
are applied to the obstructing path. Obstructing paths are reported
in the first column with code 'E'.
If the specified update target is missing from the working copy but its
immediate parent directory is present, checkout the target into its
parent directory at the specified depth. If --parents is specified,
create any missing parent directories of the target by checking them
out, too, at depth=empty.
Use the --set-depth option to set a new working copy depth on the
targets of this operation.
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
-N [--non-recursive] : obsolete; try --depth=files or --depth=immediates
--depth ARG : limit operation by depth ARG ('empty', 'files',
'immediates', or 'infinity')
--set-depth ARG : set new working copy depth to ARG ('exclude',
'empty', 'files', 'immediates', or 'infinity')
-q [--quiet] : print nothing, or only summary information
--diff3-cmd ARG : use ARG as merge command
--force : handle unversioned obstructions as changes
--ignore-externals : ignore externals definitions
--changelist [--cl] ARG : operate only on members of changelist ARG
--editor-cmd ARG : use ARG as external editor
--accept ARG : specify automatic conflict resolution action
('postpone', 'working', 'base', 'mine-conflict',
'theirs-conflict', 'mine-full', 'theirs-full',
'edit', 'launch')
(shorthand: 'p', 'mc', 'tc', 'mf', 'tf', 'e', 'l')
--parents : make intermediate directories
upgrade: Upgrade the metadata storage format for a working copy.
usage: upgrade [WCPATH...]
Local modifications are preserved.
Valid options:
-q [--quiet] : print nothing, or only summary information