# Subversion Complete Reference

This chapter is intended to be a complete reference to using Subversion. This includes the command line client (`svn`) and all its subcommands, as well as the repository administration programs (`svnadmin` and `svnlook`) and their respective subcommands.

## The Subversion Command Line Client: `svn`

To use the command line client, you type `svn`, the subcommand you wish to use Yes, yes, you don't need a subcommand to use the `--version` switch, but we'll get to that in just a minute. , and any switches or targets that you wish to operate on—there is no specific order that the subcommand and the switches must appear in. For example, all of the following are valid ways to use `svn status`:

    $ svn -v status
    $ svn status -v
    $ svn status -v myfile

You can find many more examples of how to use most client commands in and commands for managing properties in .

### `svn` Switches

While Subversion has different switches for its subcommands, all switches are global—that is, each switch is guaranteed to mean the same thing regardless of the subcommand you use it with. For example, `--verbose` (`-v`) always means verbose output, regardless of the subcommand you use it with.

`--auto-props`

  Enables auto-props, overriding the `enable-auto-props` directive in the `config` file.

`--config-dir` DIR

  Instructs Subversion to read configuration information from the specified directory instead of the default location (`.subversion` in the user's home directory).

`--diff-cmd` CMD

  Specifies an external program to use to show differences between files. When `svn diff` is invoked, it uses Subversion's internal diff engine, which provides unified diffs by default. If you want to use an external diff program, use `--diff-cmd`. You can pass switches to the diff program with the `--extensions` switch (more on that later in this section).

`--diff3-cmd` CMD

  Specifies an external program to use to merge files.

`--dry-run`

  Goes through all the motions of running a command, but makes no actual changes—either on disk or in the repository.

`--editor-cmd` CMD

  Specifies an external program to use to edit a log message or a property value.

`--encoding` ENC

  Tells Subversion that your commit message is encoded in the charset provided. The default is your operating system's native locale, and you should specify the encoding if your commit message is in any other encoding.

`--extensions` (`-x`) ARGS

  Specifies an argument or arguments that Subversion should pass to an external diff command when providing differences between files. If you wish to pass multiple arguments, you must enclose all of them in quotes (for example, `svn diff --diff-cmd /usr/bin/diff -x "-b -E"`). This switch can only be used if you also pass the `--diff-cmd` switch.

`--file` (`-F`) FILENAME

  Uses the contents of the file passed as an argument to this switch for the specified subcommand.

`--force`

  Forces a particular command or operation to run. There are some operations that Subversion will prevent you from doing in normal usage, but you can pass the force switch to tell Subversion I know what I'm doing as well as the possible repercussions of doing it, so let me at 'em. This switch is the programmatic equivalent of doing your own electrical work with the power on—if you don't know what you're doing, you're likely to get a nasty shock.

`--force-log`

  Forces a suspicious parameter passed to the `--message` (`-m`) or `--file` (`-F`) options to be accepted as valid. By default, Subversion will produce an error if parameters to these options look like they might instead be targets of the subcommand. For example, if you pass a versioned file's path to the `--file` (`-F`) option, Subversion will assume you've made a mistake, that the path was instead intended as the target of the operation, and that you simply failed to provide some other—unversioned—file as the source of your log message. To assert your intent and override these types of errors, pass the `--force-log` option to commands that accept log messages.

`--help` (`-h` or `-?`)

  If used with one or more subcommands, shows the built-in help text for each subcommand. If used alone, it displays the general client help text.

`--ignore-ancestry`

  Tells Subversion to ignore ancestry when calculating differences (rely on path contents alone).

`--incremental`

  Prints output in a format suitable for concatenation.

`--message` (`-m`) MESSAGE

  Indicates that you will specify a commit message on the command line, following this switch. For example:

      $ svn commit -m "They don't make Sunday."

`--new` ARG

  Uses ARG as the newer target.

`--no-auth-cache`

  Prevents caching of authentication information (e.g. username and password) in the Subversion administrative directories.

`--no-auto-props`

  Disables auto-props, overriding the `enable-auto-props` directive in the `config` file.

`--no-diff-deleted`

  Prevents Subversion from printing differences for deleted files. The default behavior when you remove a file is for `svn diff` to print the same differences that you would see if you had left the file but removed all the content.

`--no-ignore`

  Shows files in the status listing that would normally be omitted since they match a pattern in the svn:ignore property. See for more information.

`--non-interactive`

  In the case of an authentication failure, or insufficient credentials, prevents prompting for credentials (e.g. username or password). This is useful if you're running Subversion inside of an automated script and it's more appropriate to have Subversion fail than to prompt for more information.

`--non-recursive` (`-N`)

  Stops a subcommand from recursing into subdirectories. Most subcommands recurse by default, but some subcommands—usually those that have the potential to remove or undo your local modifications—do not.

`--notice-ancestry`

  Pay attention to ancestry when calculating differences.

`--old` ARG

  Uses ARG as the older target.

`--password` PASS

  Indicates that you are providing your password for authentication on the command line—otherwise, if it is needed, Subversion will prompt you for it.

`--quiet` (`-q`)

  Requests that the client print only essential information while performing an operation.

`--recursive` (`-R`)

  Makes a subcommand recurse into subdirectories. Most subcommands recurse by default.

`--relocate` FROM TO [PATH...]

  Used with the `svn switch` subcommand, changes the location of the repository that your working copy references. This is useful if the location of your repository changes and you have an existing working copy that you'd like to continue to use. See `svn switch` for an example.

`--revision` (`-r`) REV

  Indicates that you're going to supply a revision (or range of revisions) for a particular operation. You can provide revision numbers, revision keywords or dates (in curly braces), as arguments to the revision switch. If you wish to provide a range of revisions, you can provide two revisions separated by a colon. For example:

      $ svn log -r 1729
      $ svn log -r 1729:HEAD
      $ svn log -r 1729:1744
      $ svn log -r {2001-12-04}:{2002-02-17}
      $ svn log -r 1729:{2002-02-17}

  See for more information.

`--revprop`

  Operates on a revision property instead of a Subversion property specific to a file or directory. This switch requires that you also pass a revision with the `--revision` (`-r`) switch. See for more details on unversioned properties.

`--show-updates` (`-u`)

  Causes the client to display information about which files in your working copy are out-of-date. This doesn't actually update any of your files—it just shows you which files will be updated if you run `svn update` .

`--stop-on-copy`

  Causes a Subversion subcommand which is traversing the history of a versioned resource to stop harvesting that historical information when a copy—that is, a location in history where that resource was copied from another location in the repository—is encountered.

`--strict`

  Causes Subversion to use strict semantics, a notion which is rather vague unless talking about specific subcommands.

`--targets` FILENAME

  Tells Subversion to get the list of files that you wish to operate on from the filename you provide instead of listing all the files on the command line.

`--username` NAME

  Indicates that you are providing your username for authentication on the command line—otherwise, if it is needed, Subversion will prompt you for it.

`--verbose` (`-v`)

  Requests that the client print out as much information as it can while running any subcommand. This may result in Subversion printing out additional fields, detailed information about every file, or additional information regarding its actions.

`--version`

  Prints the client version info. This information not only includes the version number of the client, but also a listing of all repository access modules that the client can use to access a Subversion repository.

`--xml`

  Prints output in XML format.

### `svn` Subcommands

#### svn add

Add files and directories.

##### Synopsis

    svn add PATH...

##### Description

Add files and directories to your working copy and schedule them for addition to the repository. They will be uploaded and added to the repository on your next commit. If you add something and change your mind before committing, you can unschedule the addition using `svn revert`.

##### Alternate Names

None

##### Changes

Working Copy

##### Accesses Repository

No

##### Switches

    --targets FILENAME
    --non-recursive (-N)
    --quiet (-q)
    --config-dir DIR
    --auto-props
    --no-auto-props

##### Examples

To add a file to your working copy:

    $ svn add foo.c
    A         foo.c

When adding a directory, the default behavior of `svn add` is to recurse:

    $ svn add testdir
    A         testdir
    A         testdir/a
    A         testdir/b
    A         testdir/c
    A         testdir/d

You can add a directory without adding its contents:

    $ svn add --non-recursive otherdir
    A         otherdir

#### svn blame

Show author and revision information in-line for the specified files or URLs.

##### Synopsis

    svn blame TARGET...

##### Description

Show author and revision information in-line for the specified files or URLs. Each line of text is annotated at the beginning with the author (username) and the revision number for the last change to that line.

##### Alternate Names

praise, annotate, ann

##### Changes

Nothing

##### Accesses Repository

Yes

##### Switches

    --revision (-r) REV
    --username USER
    --password PASS
    --no-auth-cache
    --non-interactive
    --config-dir DIR

##### Examples

If you want to see blame annotated source for readme.txt in your test repository:

    $ svn blame http://svn.red-bean.com/repos/test/readme.txt
         3      sally This is a README file.
         5      harry You should read this.

#### svn cat

Output the contents of the specified files or URLs.

##### Synopsis

    svn cat TARGET...

##### Description

Output the contents of the specified files or URLs. For listing the contents of directories, see `svn list`.

##### Alternate Names

None

##### Changes

Nothing

##### Accesses Repository

Yes

##### Switches

    --revision (-r) REV
    --username USER
    --password PASS
    --no-auth-cache
    --non-interactive
    --config-dir DIR

##### Examples

If you want to view readme.txt in your repository without checking it out:

    $ svn cat http://svn.red-bean.com/repos/test/readme.txt
    This is a README file.
    You should read this.

If your working copy is out of date (or you have local modifications) and you want to see the `HEAD` revision of a file in your working copy, `svn cat` will automatically fetch the `HEAD` revision when you give it a path:

    $ cat foo.c
    This file is in my local working copy
    and has changes that I've made.

    $ svn cat foo.c
    Latest revision fresh from the repository!

#### svn checkout

Check out a working copy from a repository.

##### Synopsis

    svn checkout URL... [PATH]

##### Description

Check out a working copy from a repository. 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 subdirectory of PATH, with the name of the subdirectory being the basename of the URL.

##### Alternate Names

co

##### Changes

Creates a working copy.

##### Accesses Repository

Yes

##### Switches

    --revision (-r) REV
    --quiet (-q)
    --non-recursive (-N)
    --username USER
    --password PASS
    --no-auth-cache
    --non-interactive
    --config-dir DIR

##### Examples

Check out a working copy into a directory called 'mine':

    $ svn checkout file:///tmp/repos/test mine
    A  mine/a
    A  mine/b
    Checked out revision 2.
    $ ls
    mine

Check out 2 different directories into two separate working copies:

    $ svn checkout file:///tmp/repos/test  file:///tmp/repos/quiz
    A  test/a
    A  test/b
    Checked out revision 2.
    A  quiz/l
    A  quiz/m
    Checked out revision 2.
    $ ls
    quiz  test

Check out 2 different directories into two separate working copies, but place both into a directory called 'working copies':

    $ svn checkout file:///tmp/repos/test  file:///tmp/repos/quiz working-copies
    A  working-copies/test/a
    A  working-copies/test/b
    Checked out revision 2.
    A  working-copies/quiz/l
    A  working-copies/quiz/m
    Checked out revision 2.
    $ ls
    working-copies

If you interrupt a checkout (or something else interrupts your checkout like loss of connectivity, etc.), you can restart it either by issuing the identical checkout command again, or by updating the incomplete working copy:

    $ svn checkout file:///tmp/repos/test test
    A  test/a
    A  test/b
    ^C
    svn: The operation was interrupted
    svn: caught SIGINT

    $ svn checkout file:///tmp/repos/test test
    A  test/c
    A  test/d
    ^C
    svn: The operation was interrupted
    svn: caught SIGINT

    $ cd test
    $ svn update
    A  test/e
    A  test/f
    Updated to revision 3.

#### svn cleanup

Recursively clean up the working copy.

##### Synopsis

    svn cleanup [PATH...]

##### Description

Recursively clean up the working copy, removing locks resuming unfinished operations. If you ever get a working copy locked error, run this command to remove stale locks and get your working copy into a usable state again. See .

If, for some reason, an `svn update` fails due to a problem running an external diff program (e.g. user input or network failure), pass the `--diff3-cmd` to allow cleanup to complete any merging with your external diff program. You can also specify any configuration directory with the `--config-dir` switch, but you should need these switches extremely infrequently.

##### Alternate Names

None

##### Changes

Working copy

##### Accesses Repository

No

##### Switches:

    --diff3-cmd CMD
    --config-dir DIR

##### Examples

Well, there's not much to the examples here as `svn cleanup` generates no output. If you pass no PATH, `.` is used.

    $ svn cleanup

    $ svn cleanup /path/to/working-copy

#### svn commit

Send changes from your working copy to the repository.

##### Synopsis

    svn commit [PATH...]

##### Description

Send changes from your working copy to the repository. If you do not supply a log message with your commit by using either the `--file` or `--message` switch, `svn` will launch your editor for you to compose a commit message. See the `editor-cmd` section in .

If you begin a commit and Subversion launches your editor to compose the commit message, you can still abort without committing your changes. If you want to cancel your commit, just quit your editor without saving your commit message and Subversion will prompt you to either abort the commit, continue with no message, or edit the message again.

##### Alternate Names

ci (short for check in not co, which is short for checkout)

##### Changes

Working copy, repository

##### Accesses Repository

Yes

##### Switches

    --message (-m) TEXT
    --file (-F) FILE
    --quiet (-q)
    --non-recursive (-N)
    --targets FILENAME
    --force-log
    --username USER
    --password PASS
    --no-auth-cache
    --non-interactive
    --encoding ENC
    --config-dir DIR

##### Examples

Commit a simple modification to a file with the commit message on the command line and an implicit target of your current directory (`.`):

    $ svn commit -m "added howto section."
    Sending        a
    Transmitting file data .
    Committed revision 3.

Commit a modification to the file `foo.c` (explicitly specified on the command line) with the commit message in a file named `msg`:

    $ svn commit -F msg foo.c
    Sending        foo.c
    Transmitting file data .
    Committed revision 5.

If you want to use a file that's under version control for your commit message with `--file`, you need to pass the `--force-log` switch:

    $ svn commit --file file_under_vc.txt foo.c
    svn: The log message file is under version control
    svn: Log message file is a versioned file; use '--force-log' to override

    $ svn commit --force-log --file file_under_vc.txt foo.c
    Sending        foo.c
    Transmitting file data .
    Committed revision 6.

To commit a file scheduled for deletion:

    $ svn commit -m "removed file 'c'."
    Deleting       c

    Committed revision 7.

#### svn copy

Copy a file or directory in a working copy or in the repository.

##### Synopsis

    svn copy SRC DST

##### Description

Copy a file in a working copy or in the repository. SRC and DST can each be either a working copy (WC) path or URL:

WC -> WC

  Copy and schedule an item for addition (with history).

WC -> URL

  Immediately commit a copy of WC to URL.

URL -> WC

  Check out URL into WC, and schedule it for addition.

URL -> URL

  Complete server-side copy. This is usually used to branch and tag.

You can only copy files within a single repository. Subversion does not support cross-repository copying.

##### Alternate Names

cp

##### Changes

Repository if destination is a URL.

Working copy if destination is a WC path.

##### Accesses Repository

If source or destination is in the repository, or if needed to look up the source revision number.

##### Switches

    --message (-m) TEXT
    --file (-F) FILE
    --revision (-r) REV
    --quiet (-q)
    --username USER
    --password PASS
    --no-auth-cache
    --non-interactive
    --force-log
    --editor-cmd EDITOR
    --encoding ENC
    --config-dir DIR

##### Examples

Copy an item within your working copy (just schedules the copy—nothing goes into the repository until you commit):

    $ svn copy foo.txt bar.txt
    A         bar.txt
    $ svn status
    A  +   bar.txt

Copy an item in your working copy to a URL in the repository (an immediate commit, so you must supply a commit message):

    $ svn copy near.txt file:///tmp/repos/test/far-away.txt -m "Remote copy."

    Committed revision 8.

Copy an item from the repository to your working copy (just schedules the copy—nothing goes into the repository until you commit):

This is the recommended way to resurrect a dead file in your repository!

    $ svn copy file:///tmp/repos/test/far-away near-here
    A         near-here

And finally, copying between two URLs:

    $ svn copy file:///tmp/repos/test/far-away file:///tmp/repos/test/over-there -m "remote copy."

    Committed revision 9.

This is the easiest way to tag a revision in your repository—just `svn copy` that revision (usually `HEAD`) into your tags directory.

    $ svn copy file:///tmp/repos/test/trunk file:///tmp/repos/test/tags/0.6.32-prerelease -m "tag tree"

    Committed revision 12.

And don't worry if you forgot to tag—you can always specify an older revision and tag anytime:

    $ svn copy -r 11 file:///tmp/repos/test/trunk file:///tmp/repos/test/tags/0.6.32-prerelease -m "Forgot to tag at rev 11"

    Committed revision 13.

#### svn delete

Delete an item from a working copy or the repository.

##### Synopsis

    svn delete PATH...

    svn delete URL...

##### Description

Items specified by PATH are scheduled for deletion upon the next commit. Files (and directories that have not been committed) are immediately removed from the working copy. The command will not remove any unversioned or modified items; use the `--force` switch to override this behavior.

Items specified by URL are deleted from the repository via an immediate commit. Multiple URLs are committed atomically.

##### Alternate Names

del, remove, rm

##### Changes

Working copy if operating on files, Repository if operating on URLs

##### Accesses Repository

Only if operating on URLs

##### Switches

    --force
    --force-log
    --message (-m) TEXT
    --file (-F) FILE
    --quiet (-q)
    --targets FILENAME
    --username USER
    --password PASS
    --no-auth-cache
    --non-interactive
    --editor-cmd EDITOR
    --encoding ENC
    --config-dir DIR

##### Examples

Using `svn` to delete a file from your working copy merely schedules it to be deleted. When you commit, the file is deleted in the repository.

    $ svn delete myfile
    D         myfile

    $ svn commit -m "Deleted file 'myfile'."
    Deleting       myfile
    Transmitting file data .
    Committed revision 14.

Deleting a URL, however, is immediate, so you have to supply a log message:

    $ svn delete -m "Deleting file 'yourfile'" file:///tmp/repos/test/yourfile

    Committed revision 15.

Here's an example of how to force deletion of a file that has local mods:

    $ svn delete over-there
    svn: Attempting restricted operation for modified resource
    svn: Use --force to override this restriction
    svn: 'over-there' has local modifications

    $ svn delete --force over-there
    D         over-there

#### svn diff

Display the differences between two paths.

##### Synopsis

    svn diff [-r N[:M]] [--old OLD-TGT] [--new NEW-TGT] [PATH...]

    svn diff -r N:M URL

    svn diff [-r N[:M]] URL1[@N] URL2[@M]

##### Description

Display the differences between two paths. The three different ways you can use `svn diff` are:

`svn diff [-r N[:M]] [--old OLD-TGT] [--new NEW-TGT] [PATH...]` displays the differences between OLD-TGT and NEW-TGT. If PATHs are given, they are treated as relative to OLD-TGT and NEW-TGT and the output is restricted to differences in only those paths. OLD-TGT and NEW-TGT may be working copy paths or URL`[@`REV`]`. OLD-TGT defaults to the current working directory and NEW-TGT defaults to OLD-TGT. N defaults to `BASE` or, if OLD-TGT is a URL, to `HEAD`. M defaults to the current working version or, if NEW-TGT is a URL, to `HEAD`. `svn diff -r N` sets the revision of OLD-TGT to N, `svn diff -r N:M` also sets the revision of NEW-TGT to M.

`svn diff -r N:M URL` is shorthand for `svn diff -r N:M --old=URL --new=URL`.

`svn diff [-r N[:M]] URL1[@N] URL2[@M]` is shorthand for `svn diff [-r N[:M]] --old=URL1 --new=URL2`.

If TARGET is a URL, then revs N and M can be given either via the `--revision` or by using @ notation as described earlier.

If TARGET is a working copy path, then the `--revision` switch means:

`--revision N:M`

  The server compares TARGET@N and TARGET@M.

`--revision N`

  The client compares TARGET@N against working copy.

`(no --revision)`

  The client compares base and working copies of TARGET.

If the alternate syntax is used, the server compares URL1 and URL2 at revisions N and M respectively. If either N or M are omitted, a value of `HEAD` is assumed.

By default, `svn diff` ignores the ancestry of files and merely compares the contents of the two files being compared. If you use `--notice-ancestry`, the ancestry of the paths in question will be taken into consideration when comparing revisions (that is, if you run `svn diff` on two files with identical contents but different ancestry you will see the entire contents of the file as having been removed and added again).

##### Alternate Names

di

##### Changes

Nothing

##### Accesses Repository

For obtaining differences against anything but `BASE` revision in your working copy

##### Switches

    --revision (-r) REV
    --old OLD-TARGET
    --new NEW-TARGET
    --extensions (-x) "ARGS"
    --non-recursive (-N)
    --diff-cmd CMD
    --notice-ancestry
    --username USER
    --password PASS
    --no-auth-cache
    --non-interactive
    --no-diff-deleted
    --config-dir DIR

##### Examples

Compare `BASE` and your working copy (one of the most popular uses of `svn diff`):

    $ svn diff COMMITTERS
    Index: COMMITTERS
    ===================================================================
    --- COMMITTERS	(revision 4404)
    +++ COMMITTERS	(working copy)

See how your working copy's modifications compare against an older revision:

    $ svn diff -r 3900 COMMITTERS
    Index: COMMITTERS
    ===================================================================
    --- COMMITTERS	(revision 3900)
    +++ COMMITTERS	(working copy)

Compare revision 3000 to revision 3500 using @ syntax:

    $ svn diff http://svn.collab.net/repos/svn/trunk/COMMITTERS@3000 http://svn.collab.net/repos/svn/trunk/COMMITTERS@3500
    Index: COMMITTERS
    ===================================================================
    --- COMMITTERS	(revision 3000)
    +++ COMMITTERS	(revision 3500)
    …

Compare revision 3000 to revision 3500 using range notation (you only pass the one URL in this case):

    $ svn diff -r 3000:3500 http://svn.collab.net/repos/svn/trunk/COMMITTERS
    Index: COMMITTERS
    ===================================================================
    --- COMMITTERS	(revision 3000)
    +++ COMMITTERS	(revision 3500)

Compare revision 3000 to revision 3500 of all files in `trunk` using range notation:

    $ svn diff -r 3000:3500 http://svn.collab.net/repos/svn/trunk

Compare revision 3000 to revision 3500 of only three files in `trunk` using range notation:

    $ svn diff -r 3000:3500 --old http://svn.collab.net/repos/svn/trunk COMMITTERS README HACKING

If you have a working copy, you can obtain the differences without typing in the long URLs:

    $ svn diff -r 3000:3500 COMMITTERS
    Index: COMMITTERS
    ===================================================================
    --- COMMITTERS	(revision 3000)
    +++ COMMITTERS	(revision 3500)

Use `--diff-cmd` CMD `-x` to pass arguments directly to the external diff program

    $ svn diff --diff-cmd /usr/bin/diff -x "-i -b" COMMITTERS
    Index: COMMITTERS
    ===================================================================
    0a1,2
    > This is a test
    >

#### svn export

Export a clean directory tree.

##### Synopsis

    svn export [-r REV] URL [PATH]

    svn export PATH1 PATH2

##### Description

The first form 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.

The second form exports a clean directory tree from the working copy specified by PATH1 into PATH2. All local changes will be preserved, but files not under version control will not be copied.

##### Alternate Names

None

##### Changes

Local disk

##### Accesses Repository

Only if exporting from a URL

##### Switches

    --revision (-r) REV
    --quiet (-q)
    --force
    --username USER
    --password PASS
    --no-auth-cache
    --non-interactive
    --config-dir DIR

##### Examples

Export from your working copy (doesn't print every file and directory):

    $ svn export a-wc my-export
    Export complete.

Export directly from the repository (prints every file and directory):

    $ svn export file:///tmp/repos my-export
    A  my-export/test
    A  my-export/quiz
    …
    Exported revision 15.

#### svn help

Help!

##### Synopsis

    svn help [SUBCOMMAND...]

##### Description

This is your best friend when you're using Subversion and this book isn't within reach!

##### Alternate Names

?, h

##### Changes

Nothing

##### Accesses Repository

No

##### Switches

    --version
    --quiet (-q)

#### svn import

Recursively commit a copy of PATH to URL.

##### Synopsis

    svn import [PATH] URL

##### Description

Recursively commit a copy of PATH to URL. If PATH is omitted `.` is assumed. Parent directories are created in the repository as necessary.

##### Alternate Names

None

##### Changes

Repository

##### Accesses Repository

Yes

##### Switches

    --message (-m) TEXT
    --file (-F) FILE
    --quiet (-q)
    --non-recursive (-N)
    --username USER
    --password PASS
    --no-auth-cache
    --non-interactive
    --force-log
    --editor-cmd EDITOR
    --encoding ENC
    --config-dir DIR
    --auto-props
    --no-auto-props

##### Examples

This imports the local directory `myproj` into the root of your repository:

    $ svn import -m "New import" myproj http://svn.red-bean.com/repos/test
    Adding         myproj/sample.txt
    …
    Transmitting file data .........
    Committed revision 16.

This imports the local directory `myproj` into `trunk/vendors` in your repository. The directory `trunk/vendors` need not exist before you import into it—`svn import` will recursively create directories for you:

    $ svn import -m "New import" myproj \
        http://svn.red-bean.com/repos/test/trunk/vendors/myproj
    Adding         myproj/sample.txt
    …
    Transmitting file data .........
    Committed revision 19.

After importing data, note that the original tree is not under version control. To start working, you still need to `svn checkout` a fresh working copy of the tree.

#### svn info

Print information about PATHs.

##### Synopsis

    svn info [PATH...]

##### Description

Print information about paths in your working copy, including:

- Path

- Name

- URL

- Revision

- Node Kind

- Last Changed Author

- Last Changed Revision

- Last Changed Date

- Text Last Updated

- Properties Last Updated

- Checksum

##### Alternate Names

None

##### Changes

Nothing

##### Accesses Repository

No

##### Switches

    --targets FILENAME
    --recursive (-R)
    --config-dir DIR

##### Examples

`svn info` will show you all the useful information that it has for items in your working copy. It will show information for files:

    $ svn info foo.c
    Path: foo.c
    Name: foo.c
    URL: http://svn.red-bean.com/repos/test/foo.c
    Revision: 4417
    Node Kind: file
    Schedule: normal
    Last Changed Author: sally
    Last Changed Rev: 20
    Last Changed Date: 2003-01-13 16:43:13 -0600 (Mon, 13 Jan 2003)
    Text Last Updated: 2003-01-16 21:18:16 -0600 (Thu, 16 Jan 2003)
    Properties Last Updated: 2003-01-13 21:50:19 -0600 (Mon, 13 Jan 2003)
    Checksum: /3L38YwzhT93BWvgpdF6Zw==

It will also show information for directories:

    $ svn info vendors
    Path: trunk
    URL: http://svn.red-bean.com/repos/test/vendors
    Revision: 19
    Node Kind: directory
    Schedule: normal
    Last Changed Author: harry
    Last Changed Rev: 19
    Last Changed Date: 2003-01-16 23:21:19 -0600 (Thu, 16 Jan 2003)

#### svn list

List directory entries in the repository.

##### Synopsis

    svn list [TARGET...]

##### Description

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.

The default TARGET is `.`, meaning the repository URL of the current working copy directory.

With `--verbose`, the following fields show the status of the item:

- Revision number of the last commit

- Author of the last commit

- Size (in bytes)

- Date and time of the last commit

##### Alternate Names

ls

##### Changes

Nothing

##### Accesses Repository

Yes

##### Switches

    --revision (-r) REV
    --verbose (-v)
    --recursive (-R)
    --username USER
    --password PASS
    --no-auth-cache
    --non-interactive
    --config-dir DIR

##### Examples

`svn list` is most useful if you want to see what files a repository has without downloading a working copy:

    $ svn list http://svn.red-bean.com/repos/test/support
    README.txt
    INSTALL
    examples/
    …

Like UNIX `ls`, you can also pass the `--verbose` switch for additional information:

    $ svn list --verbose file:///tmp/repos
         16 sally         28361 Jan 16 23:18 README.txt
         27 sally             0 Jan 18 15:27 INSTALL
         24 harry               Jan 18 11:27 examples/

For further details, see .

#### svn log

Display commit log messages.

##### Synopsis

    svn log [PATH]

    svn log URL [PATH...]

##### Description

The default target is the path of your current directory. If no arguments are supplied, `svn log` shows the log messages for all files and directories inside of (and including) the current working directory of your working copy. You can refine the results by specifying a path, one or more revisions, or any combination of the two. The default revision range for a local path is `BASE:1`.

If you specify a URL alone, then it prints log messages for everything that the URL contains. If you add paths past the URL, only messages for those paths under that URL will be printed. The default revision range for a URL is `HEAD:1`.

With `--verbose`, `svn log` will also print all affected paths with each log message. With `--quiet`, `svn log` will not print the log message body itself (this is compatible with `--verbose`).

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 branch points.

##### Alternate Names

None

##### Changes

Nothing

##### Accesses Repository

Yes

##### Switches

    --revision (-r) REV
    --quiet (-q)
    --verbose (-v)
    --targets FILENAME
    --stop-on-copy
    --incremental
    --xml
    --username USER
    --password PASS
    --no-auth-cache
    --non-interactive
    --config-dir DIR

##### Examples

You can see the log messages for all the paths that changed in your working copy by running `svn log` from the top:

    $ svn log
    ------------------------------------------------------------------------
    r20 | harry | 2003-01-17 22:56:19 -0600 (Fri, 17 Jan 2003) | 1 line

    Tweak.
    ------------------------------------------------------------------------
    r17 | sally | 2003-01-16 23:21:19 -0600 (Thu, 16 Jan 2003) | 2 lines
    …

Examine all log messages for a particular file in your working copy:

    $ svn log foo.c
    ------------------------------------------------------------------------
    r32 | sally | 2003-01-13 00:43:13 -0600 (Mon, 13 Jan 2003) | 1 line

    Added defines.
    ------------------------------------------------------------------------
    r28 | sally | 2003-01-07 21:48:33 -0600 (Tue, 07 Jan 2003) | 3 lines
    …

If you don't have a working copy handy, you can log a URL:

    $ svn log http://svn.red-bean.com/repos/test/foo.c
    ------------------------------------------------------------------------
    r32 | sally | 2003-01-13 00:43:13 -0600 (Mon, 13 Jan 2003) | 1 line

    Added defines.
    ------------------------------------------------------------------------
    r28 | sally | 2003-01-07 21:48:33 -0600 (Tue, 07 Jan 2003) | 3 lines
    …

If you want several distinct paths underneath the same URL, you can use the `URL [PATH...]` syntax.

    $ svn log http://svn.red-bean.com/repos/test/ foo.c bar.c
    ------------------------------------------------------------------------
    r32 | sally | 2003-01-13 00:43:13 -0600 (Mon, 13 Jan 2003) | 1 line

    Added defines.
    ------------------------------------------------------------------------
    r31 | harry | 2003-01-10 12:25:08 -0600 (Fri, 10 Jan 2003) | 1 line

    Added new file bar.c
    ------------------------------------------------------------------------
    r28 | sally | 2003-01-07 21:48:33 -0600 (Tue, 07 Jan 2003) | 3 lines
    …

That is the same as explicitly placing both URLs on the command line:

    $ svn log http://svn.red-bean.com/repos/test/foo.c \
              http://svn.red-bean.com/repos/test/bar.c
    …

When you're concatenating the results of multiple calls to the log command, you may want to use the `--incremental` switch. `svn log` normally prints out a dashed line at the beginning of a log message, after each subsequent log message, and following the final log message. If you ran svn log on a range of two revisions, you would get this:

    $ svn log -r 14:15
    ------------------------------------------------------------------------
    r14 | ...

    ------------------------------------------------------------------------
    r15 | ...

    ------------------------------------------------------------------------

However, if you wanted to gather 2 non-sequential log messages into a file, you might do something like this:

    $ svn log -r 14 > mylog
    $ svn log -r 19 >> mylog
    $ svn log -r 27 >> mylog
    $ cat mylog
    ------------------------------------------------------------------------
    r14 | ...

    ------------------------------------------------------------------------
    ------------------------------------------------------------------------
    r19 | ...

    ------------------------------------------------------------------------
    ------------------------------------------------------------------------
    r27 | ...

    ------------------------------------------------------------------------

You can avoid the clutter of the double dashed lines in your output by using the incremental switch:

    $ svn log --incremental -r 14 > mylog
    $ svn log --incremental -r 19 >> mylog
    $ svn log --incremental -r 27 >> mylog
    $ cat mylog
    ------------------------------------------------------------------------
    r14 | ...

    ------------------------------------------------------------------------
    r19 | ...

    ------------------------------------------------------------------------
    r27 | ...

The `--incremental` switch provides similar output control when using the `--xml` switch.

If you run `svn log` on a specific path and provide a specific revision and get no output at all

    $ svn log -r 20 http://svn.red-bean.com/untouched.txt
    ------------------------------------------------------------------------

That just means that the path was not modified in that revision. If you log from the top of the repository, or know the file that changed in that revision, you can specify it explicitly:

    $ svn log -r 20 touched.txt
    ------------------------------------------------------------------------
    r20 | sally | 2003-01-17 22:56:19 -0600 (Fri, 17 Jan 2003) | 1 line

    Made a change.
    ------------------------------------------------------------------------

#### svn merge

Apply the differences between two sources to a working copy path.

##### Synopsis

    svn merge sourceURL1[@N] sourceURL2[@M] [WCPATH]

    svn merge -r N:M SOURCE [PATH]

##### Description

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.

In the second form, SOURCE can be a URL or working copy item, in which case the corresponding URL is used. This URL, at revisions N and M, defines the two sources to be compared.

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.

Unlike `svn diff`, the merge command takes the ancestry of a file into consideration when performing a merge operation. This is very important when you're merging changes from one branch into another and you've renamed a file on one branch but not the other.

##### Alternate Names

None

##### Changes

Working copy

##### Accesses Repository

Only if working with URLs

##### Switches

    --revision (-r) REV
    --non-recursive (-N)
    --quiet (-q)
    --force
    --dry-run
    --diff3-cmd CMD
    --ignore-ancestry
    --username USER
    --password PASS
    --no-auth-cache
    --non-interactive
    --config-dir DIR

##### Examples

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

#### svn mkdir

Create a new directory under version control.

##### Synopsis

    svn mkdir PATH...

    svn mkdir URL...

##### Description

Create a directory with a name given by the final component of the PATH or URL. A directory specified by a working copy PATH is scheduled for addition in the working copy. A directory specified by a URL is created in the repository via an immediate commit. Multiple directory URLs are committed atomically. In both cases all the intermediate directories must already exist.

##### Alternate Names

None

##### Changes

Working copy, repository if operating on a URL

##### Accesses Repository

Only if operating on a URL

##### Switches

    --message (-m) TEXT
    --file (-F) FILE
    --quiet (-q)
    --username USER
    --password PASS
    --no-auth-cache
    --non-interactive
    --editor-cmd EDITOR
    --encoding ENC
    --force-log
    --config-dir DIR

##### Examples

Create a directory in your working copy:

    $ svn mkdir newdir
    A         newdir

Create one in the repository (instant commit, so a log message is required):

    $ svn mkdir -m "Making a new dir." http://svn.red-bean.com/repos/newdir

    Committed revision 26.

#### svn move

Move a file or directory.

##### Synopsis

    svn move SRC DST

##### Description

This command moves a file or directory in your working copy or in the repository.

This command is equivalent to an `svn copy` followed by `svn delete`.

Subversion does not support moving between working copies and URLs. In addition, you can only move files within a single repository—Subversion does not support cross-repository moving.

WC -> WC

  Move and schedule a file or directory for addition (with history).

URL -> URL

  Complete server-side rename.

##### Alternate Names

mv, rename, ren

##### Changes

Working copy, repository if operating on a URL

##### Accesses Repository

Only if operating on a URL

##### Switches

    --message (-m) TEXT
    --file (-F) FILE
    --revision (-r) REV
    --quiet (-q)
    --force
    --username USER
    --password PASS
    --no-auth-cache
    --non-interactive
    --editor-cmd EDITOR
    --encoding ENC
    --force-log
    --config-dir DIR

##### Examples

Move a file in your working copy:

    $ svn move foo.c bar.c
    A         bar.c
    D         foo.c

Move a file in the repository (an immediate commit, so it requires a commit message):

    $ svn move -m "Move a file" http://svn.red-bean.com/repos/foo.c \
                                http://svn.red-bean.com/repos/bar.c

    Committed revision 27.

#### svn propdel

Remove a property from an item.

##### Synopsis

    svn propdel PROPNAME [PATH...]

    svn propdel PROPNAME --revprop -r REV [URL]

##### Description

This removes properties from files, directories, or revisions. The first form removes versioned properties in your working copy, while the second removes unversioned remote properties on a repository revision.

##### Alternate Names

pdel, pd

##### Changes

Working copy, repository only if operating on a URL

##### Accesses Repository

Only if operating on a URL

##### Switches

    --quiet (-q)
    --recursive (-R)
    --revision (-r) REV
    --revprop
    --username USER
    --password PASS
    --no-auth-cache
    --non-interactive
    --config-dir DIR

##### Examples

Delete a property from a file in your working copy

    $ svn propdel svn:mime-type  some-script
    property 'svn:mime-type' deleted from 'some-script'.

Delete a revision property:

    $ svn propdel --revprop -r 26 release-date
    property 'release-date' deleted from repository revision '26'

#### svn propedit

Edit the property of one or more items under version control.

##### Synopsis

    svn propedit PROPNAME PATH...

    svn propedit PROPNAME --revprop -r REV [URL]

##### Description

Edit one or more properties using your favorite editor. The first form edits versioned properties in your working copy, while the second edits unversioned remote properties on a repository revision.

##### Alternate Names

pedit, pe

##### Changes

Working copy, repository only if operating on a URL

##### Accesses Repository

Only if operating on a URL

##### Switches

    --revision (-r) REV
    --revprop
    --username USER
    --password PASS
    --no-auth-cache
    --non-interactive
    --encoding ENC
    --editor-cmd EDITOR
    --config-dir DIR

##### Examples

`svn propedit` makes it easy to modify properties that have multiple values:

    $ svn propedit svn:keywords  foo.c
        <svn will launch your favorite editor here, with a buffer open
        containing the current contents of the svn:keywords property.  You
        can add multiple values to a property easily here by entering one
        value per line.>
    Set new value for property 'svn:keywords' on 'foo.c'

#### svn propget

Print the value of a property.

##### Synopsis

    svn propget PROPNAME [PATH...]

    svn propget PROPNAME --revprop -r REV [URL]

##### Description

Print the value of a property on files, directories, or revisions. The first form prints the versioned property of an item or items in your working copy, while the second prints unversioned remote property on a repository revision. See for more information on properties.

##### Alternate Names

pget, pg

##### Changes

Working copy, repository only if operating on a URL

##### Accesses Repository

Only if operating on a URL

##### Switches

    --recursive (-R)
    --revision (-r) REV
    --revprop
    --strict
    --username USER
    --password PASS
    --no-auth-cache
    --non-interactive
    --config-dir DIR

##### Examples

Examine a property of a file in your working copy:

    $ svn propget svn:keywords foo.c
    Author
    Date
    Rev

The same goes for a revision property:

    $ svn propget svn:log --revprop -r 20
    Began journal.

#### svn proplist

List all properties.

##### Synopsis

    svn proplist [PATH...]

    svn proplist --revprop -r REV [URL]

##### Description

List all properties on files, directories, or revisions. The first form lists versioned properties in your working copy, while the second lists unversioned remote properties on a repository revision.

##### Alternate Names

plist, pl

##### Changes

Working copy, repository only if operating on a URL

##### Accesses Repository

Only if operating on a URL

##### Switches

    --verbose (-v)
    --recursive (-R)
    --revision (-r) REV
    --quiet (-q)
    --revprop
    --username USER
    --password PASS
    --no-auth-cache
    --non-interactive
    --config-dir DIR

##### Examples

You can use proplist to see the properties on an item in your working copy:

    $ svn proplist foo.c
    Properties on 'foo.c':
      svn:mime-type
      svn:keywords
      owner

But with the `--verbose` flag, svn proplist is extremely handy as it also shows you the values for the properties:

    $ svn proplist --verbose foo.c
    Properties on 'foo.c':
      svn:mime-type : text/plain
      svn:keywords : Author Date Rev
      owner : sally

#### svn propset

Set PROPNAME to PROPVAL on files, directories, or revisions.

##### Synopsis

    svn propset PROPNAME [PROPVAL | -F VALFILE] PATH...

    svn propset PROPNAME --revprop -r REV [PROPVAL | -F VALFILE] [URL]

##### Description

Set PROPNAME to PROPVAL on files, directories, or revisions. The first example creates a versioned, local property change in the working copy, and the second creates an unversioned, remote property change on a repository revision.

Subversion has a number of special properties that affect its behavior. See for more on these properties.

##### Alternate Names

pset, ps

##### Changes

Working copy, repository only if operating on a URL

##### Accesses Repository

Only if operating on a URL

##### Switches

    --file (-F) FILE
    --quiet (-q)
    --revision (-r) REV
    --targets FILENAME
    --recursive (-R)
    --revprop
    --username USER
    --password PASS
    --no-auth-cache
    --non-interactive
    --encoding ENC
    --force
    --config-dir DIR

##### Examples

Set the mimetype on a file:

    $ svn propset svn:mime-type image/jpeg foo.jpg
    property 'svn:mime-type' set on 'foo.jpg'

On a UNIX system, if you want a file to have the executable permission set:

    $ svn propset svn:executable ON somescript
    property 'svn:executable' set on 'somescript'

Perhaps you have an internal policy to set certain properties for the benefit of your coworkers:

    $ svn propset owner sally foo.c
    property 'owner' set on 'foo.c'

If you made a mistake in a log message for a particular revision and want to change it, use `--revprop` and set svn:log to the new log message:

    $ svn propset --revprop -r 25 svn:log "Journaled about trip to New York."
    property 'svn:log' set on repository revision '25'

Or, if you don't have a working copy, you can provide a URL.

    $ svn propset --revprop -r 26 svn:log "Document nap." http://svn.red-bean.com/repos
    property 'svn:log' set on repository revision '25'

Lastly, you can tell propset to take its input from a file. You could even use this to set the contents of a property to something binary:

    $ svn propset owner-pic -F sally.jpg moo.c
    property 'owner-pic' set on 'moo.c'

By default, you cannot modify revision properties in a Subversion repository. Your repository administrator must explicitly enable revision property modifications by creating a hook named `pre-revprop-change`. See for more information on hook scripts.

#### svn resolved

Remove conflicted state on working copy files or directories.

##### Synopsis

    svn resolved PATH...

##### Description

Remove conflicted state on working copy files or directories. This routine does not semantically resolve conflict markers; it merely removes conflict-related artifact files and allows PATH to be committed again; that is, it tells Subversion that the conflicts have been resolved. See for an in-depth look at resolving conflicts.

##### Alternate Names

None

##### Changes

Working copy

##### Accesses Repository

No

##### Switches

    --targets FILENAME
    --recursive (-R)
    --quiet (-q)
    --config-dir DIR

##### Examples

If you get a conflict on an update, your working copy will sprout three new files:

    $ svn update
    C  foo.c
    Updated to revision 31.
    $ ls
    foo.c
    foo.c.mine
    foo.c.r30
    foo.c.r31

Once you've resolved the conflict and `foo.c` is ready to be committed, run `svn resolved` to let your working copy know you've taken care of everything.

You can just remove the conflict files and commit, but `svn resolved` fixes up some bookkeeping data in the working copy administrative area in addition to removing the conflict files, so we recommend that you use this command.

#### svn revert

Undo all local edits.

##### Synopsis

    svn revert PATH...

##### Description

Reverts any local changes to a file or directory and resolves any conflicted states. `svn revert` will not only revert the contents of an item in your working copy, but also any property changes. Finally, you can use it to undo any scheduling operations that you may have done (e.g. files scheduled for addition or deletion can be unscheduled).

##### Alternate Names

None

##### Changes

Working copy

##### Accesses Repository

No

##### Switches

    --targets FILENAME
    --recursive (-R)
    --quiet (-q)
    --config-dir DIR

##### Examples

Discard changes to a file:

    $ svn revert foo.c
    Reverted foo.c

If you want to revert a whole directory of files, use the `--recursive` flag:

    $ svn revert --recursive .
    Reverted newdir/afile
    Reverted foo.c
    Reverted bar.txt

Lastly, you can undo any scheduling operations:

    $ svn add mistake.txt whoops
    A         mistake.txt
    A         whoops
    A         whoops/oopsie.c

    $ svn revert mistake.txt whoops
    Reverted mistake.txt
    Reverted whoops

    $ svn status
    ?      mistake.txt
    ?      whoops

If you provide no targets to `svn revert`, it will do nothing—to protect you from accidentally losing changes in your working copy, `svn revert` requires you to provide at least one target.

#### svn status

Print the status of working copy files and directories.

##### Synopsis

    svn status [PATH...]

##### Description

Print the status of working copy files and directories. With no arguments, it prints only locally modified items (no repository access). With `--show-updates`, add working revision and server out-of-date information. With `--verbose`, print full revision information on every item.

The first five columns in the output are each one character wide, and each column gives you information about different aspects of each working copy item.

The first column indicates that an item was added, deleted, or otherwise changed.

' '

  No modifications.

'A'

  Item is scheduled for Addition.

'D'

  Item is scheduled for Deletion.

'M'

  Item has been modified.

'C'

  Item is in conflict with updates received from the repository.

'X'

  Item is related to an externals definition.

'I'

  Item is being ignored (e.g. with the svn:ignore property).

'?'

  Item is not under version control.

'!'

  Item is missing (e.g. you moved or deleted it without using `svn`). This also indicates that a directory is incomplete (a checkout or update was interrupted).

'~'

  Item is versioned as a directory, but has been replaced by a file, or vice versa.

The second column tells the status of a file's or directory's properties.

' '

  No modifications.

'M'

  Properties for this item have been modified.

'C'

  Properties for this item are in conflict with property updates received from the repository.

The third column is populated only if the working copy directory is locked.

' '

  Item is not locked.

'L'

  Item is locked.

The fourth column is populated only if the item is scheduled for addition-with-history.

' '

  No history scheduled with commit.

'+'

  History scheduled with commit.

The fifth column is populated only if the item is switched relative to its parent (see ).

' '

  Item is a child of its parent directory.

'S'

  Item is switched.

The out-of-date information appears in the eighth column (only if you pass the `--show-updates` switch).

' '

  The item in your working copy is up-to-date.

'*'

  A newer revision of the item exists on the server.

The remaining fields are variable width and delimited by spaces. The working revision is the next field if the `--show-updates` or `--verbose` switches are passed.

If the `--verbose` switch is passed, the last committed revision and last committed author are displayed next.

The working copy path is always the final field, so it can include spaces.

##### Alternate Names

stat, st

##### Changes

Nothing

##### Accesses Repository

Only if using `--show-updates`

##### Switches

    --show-updates (-u)
    --verbose (-v)
    --non-recursive (-N)
    --quiet (-q)
    --no-ignore
    --username USER
    --password PASS
    --no-auth-cache
    --non-interactive
    --config-dir

##### Examples

This is the easiest way to find out what changes you have made to your working copy:

    $ svn status wc
     M     wc/bar.c
    A  +   wc/qax.c

If you want to find out what files in your working copy are out-of-date, pass the `--show-updates` switch (this will not make any changes to your working copy). Here you can see that `wc/foo.c` has changed in the repository since we last updated our working copy:

    $ svn status --show-updates wc
     M           965    wc/bar.c
           *     965    wc/foo.c
    A  +         965    wc/qax.c
    Status against revision:    981

`--show-updates` only places an asterisk next to items that are out of date (that is, items that will be updated from the repository if you run `svn update`). `--show-updates` does not cause the status listing to reflect the repository's version of the item.

And finally, the most information you can get out of the status subcommand:

    $ svn status --show-updates --verbose wc
     M           965       938 sally        wc/bar.c
           *     965       922 harry        wc/foo.c
    A  +         965       687 harry        wc/qax.c
                 965       687 harry        wc/zig.c
    Head revision:   981

For many more examples of `svn status`, see .

#### svn switch

Update working copy to a different URL.

##### Synopsis

    svn switch URL [PATH]

##### Description

This subcommand updates your working copy to mirror a new URL—usually a URL which shares a common ancestor with your working copy, although not necessarily. This is the Subversion way to move a working copy to a new branch. See for an in-depth look at switching.

##### Alternate Names

sw

##### Changes

Working copy

##### Accesses Repository

Yes

##### Switches

    --revision (-r) REV
    --non-recursive (-N)
    --quiet (-q)
    --diff3-cmd CMD
    --relocate
    --username USER
    --password PASS
    --no-auth-cache
    --non-interactive
    --config-dir DIR

##### Examples

If you're currently inside the directory `vendors` which was branched to `vendors-with-fix` and you'd like to switch your working copy to that branch:

    $ svn switch http://svn.red-bean.com/repos/branches/vendors-with-fix .
    U  myproj/foo.txt
    U  myproj/bar.txt
    U  myproj/baz.c
    U  myproj/qux.c
    Updated to revision 31.

And to switch back, just provide the URL to the location in the repository from which you originally checked out your working copy:

    $ svn switch http://svn.red-bean.com/repos/trunk/vendors .
    U  myproj/foo.txt
    U  myproj/bar.txt
    U  myproj/baz.c
    U  myproj/qux.c
    Updated to revision 31.

You can just switch part of your working copy to a branch if you don't want to switch your entire working copy.

Sometimes an administrator might change the "base location" of your repository — in other words, the contents of the repository doesn't change, but the main URL used to reach the root of the repository does. For example, the hostname may change, or the URL schema, or perhaps just the path which leads to the repository. Rather than checkout a new working copy, you can have the `svn switch` command "rewrite" the the beginnings of all the URLs in your working copy. Use the `--relocate` command to do the substitution. No file contents are changed, nor is the repository contacted. It's similar to running a perl script over your working copy `.svn/` directories which runs `s/OldRoot/NewRoot/`.

    $ svn checkout file:///tmp/repos test
    A  test/a
    A  test/b
    …

    $ mv repos newlocation
    $ cd test/

    $ svn update
    svn: Unable to open an ra_local session to URL
    svn: Unable to open repository 'file:///tmp/repos'

    $ svn switch --relocate file:///tmp/repos file:///tmp/newlocation .
    $ svn update
    At revision 3.

#### svn update

Update your working copy.

##### Synopsis

    svn update [PATH...]

##### Description

`svn update` brings changes from the repository into your working copy. If no revision given, it brings your working copy up-to-date with the `HEAD` revision. Otherwise, it synchronizes the working copy to the revision given by the `--revision` switch.

For each updated item a line will start with a character reporting the action taken. These characters have the following meaning:

A

  Added

D

  Deleted

U

  Updated

C

  Conflict

G

  Merged

A character in the first column signifies an update to the actual file, while updates to the file's properties are shown in the second column.

##### Alternate Names

up

##### Changes

Working copy

##### Accesses Repository

Yes

##### Switches

    --revision (-r) REV
    --non-recursive (-N)
    --quiet (-q)
    --diff3-cmd CMD
    --username USER
    --password PASS
    --no-auth-cache
    --non-interactive
    --config-dir DIR

##### Examples

Pick up repository changes that have happened since your last update:

    $ svn update
    A  newdir/toggle.c
    A  newdir/disclose.c
    A  newdir/launch.c
    D  newdir/README
    Updated to revision 32.

You can also update your working copy to an older revision (Subversion doesn't have the concept of sticky files like CVS does; see ):

    $ svn update -r30
    A  newdir/README
    D  newdir/toggle.c
    D  newdir/disclose.c
    D  newdir/launch.c
    U  foo.c
    Updated to revision 30.

If you want to examine an older revision of a single file, you may want to use `svn cat`.

## `svnadmin`

`svnadmin` is the administrative tool for monitoring and repairing your Subversion repository. For detailed information, see .

Since `svnadmin` works via direct repository access (and thus can only be used on the machine that holds the repository), it refers to the repository with a path, not a URL.

### `svnadmin` Switches

`--bdb-log-keep`

  (Berkeley DB specific) Disable automatic log removal of database log files.

`--bdb-txn-nosync`

  (Berkeley DB specific) Disables fsync when committing database transactions.

`--bypass-hooks`

  Bypass the repository hook system.

`--clean-logs`

  Removes unused Berkeley DB logs.

`--force-uuid`

  By default, when loading data into repository that already contains revisions, `svnadmin` will ignore the `UUID` from the dump stream. This switch will cause the repository's `UUID` to be set to the `UUID` from the stream.

`--ignore-uuid`

  By default, when loading an empty repository, `svnadmin` will use the `UUID` from the dump stream. This switch will cause that UUID to be ignored.

`--incremental`

  Dump a revision only as a diff against the previous revision, instead of the usual fulltext.

`--parent-dir DIR`

  When loading a dumpfile, root paths at DIR instead of /.

`--revision` (`-r`) ARG

  Specify a particular revision to operate on.

`--quiet`

  Do not show normal progress—show only errors.

### `svnadmin` Subcommands

#### svnadmin create

Create a new, empty repository.

##### Synopsis

    svnadmin create REPOS_PATH

##### Description

Create a new, empty repository at the path provided. If the provided directory does not exist, it will be created for you. Remember, `svnadmin` works only with local paths, not URLs.

##### Switches

    --bdb-txn-nosync
    --bdb-log-keep

##### Examples

Creating a new repository is just this easy:

    $ svnadmin create /usr/local/svn/repos

#### svnadmin deltify

Deltify changed paths in a revision range.

##### Synopsis

    svnadmin deltify [-r LOWER[:UPPER]] REPOS_PATH

##### Description

`svnadmin deltify` only exists in 1.0.x due to historical reasons. This command is deprecated and no longer needed.

It dates from a time when Subversion offered administrators greater control over compression strategies in the repository. This turned out to be a lot of complexity for very little gain, and this feature was deprecated.

##### Switches

    --revision (-r)
    --quiet

#### svnadmin dump

Dump the contents of filesystem to stdout.

##### Synopsis

    svnadmin dump REPOS_PATH [-r LOWER[:UPPER]] [--incremental]

##### Description

Dump the contents of filesystem to stdout in a dumpfile portable format, sending feedback to stderr. Dump revisions LOWER rev through UPPER rev. If no revisions are given, dump all revision trees. If only LOWER is given, dump that one revision tree. See for a practical use.

##### Switches

    --revision (-r)
    --incremental
    --quiet

##### Examples

Dump your whole repository:

    $ svnadmin dump /usr/local/svn/repos
    SVN-fs-dump-format-version: 1
    Revision-number: 0
    * Dumped revision 0.
    Prop-content-length: 56
    Content-length: 56
    …

Incrementally dump a single transaction from your repository:

    $ svnadmin dump /usr/local/svn/repos -r 21 --incremental
    * Dumped revision 21.
    SVN-fs-dump-format-version: 1
    Revision-number: 21
    Prop-content-length: 101
    Content-length: 101
    …

#### svnadmin help

##### Synopsis

    svnadmin help [SUBCOMMAND...]

##### Description

This subcommand is useful when you're trapped on a desert island with neither a net connection nor a copy of this book.

##### Alternate Names

?, h

#### svnadmin hotcopy

Make a hot copy of a repository.

##### Synopsis

    svnadmin hotcopy OLD_REPOS_PATH NEW_REPOS_PATH

##### Description

This subcommand makes a full hot backup of your repository, including all hooks, configuration files, and, of course, database files. If you pass the `--clean-logs` switch, `svnadmin` will perform a hotcopy of your repository, and then remove unused Berkeley DB logs from the original repository. You can run this command at any time and make a safe copy of the repository, regardless of whether other processes are using the repository.

##### Switches

    --clean-logs

#### svnadmin list-dblogs

Ask Berkeley DB which log files exist for a given svn repository.

##### Synopsis

    svnadmin list-dblogs REPOS_PATH

##### Description

Berkeley DB creates logs of all changes to the repository, which allow it to recover in the face of catastrophe. Unless you enable `DB_LOGS_AUTOREMOVE`, the log files accumulate, although most are no longer used and can be deleted to reclaim disk space. See for more information.

#### svnadmin list-unused-dblogs

Ask Berkeley DB which log files can be safely deleted.

##### Synopsis

    svnadmin list-unused-dblogs REPOS_PATH

##### Description

Berkeley DB creates logs of all changes to the repository, which allow it to recover in the face of catastrophe. Unless you enable `DB_LOGS_AUTOREMOVE`, the log files accumulate, although most are no longer used and can be deleted to reclaim disk space. See for more information.

##### Examples

Remove all unused log files from a repository:

    $ svnadmin list-unused-dblogs /path/to/repos
    /path/to/repos/log.0000000031
    /path/to/repos/log.0000000032
    /path/to/repos/log.0000000033

    $ svnadmin list-unused-dblogs /path/to/repos | xargs rm
    ## disk space reclaimed!

#### svnadmin load

Read a dumpfile-formatted stream from stdin.

##### Synopsis

    svnadmin load REPOS_PATH

##### Description

Read a dumpfile-formatted stream from stdin, committing new revisions into the repository's filesystem. Send progress feedback to stdout.

##### Switches

    --quiet (-q)
    --ignore-uuid
    --force-uuid
    --parent-dir

##### Example

This shows the beginning of loading a repository from a backup file (made, of course, with `svn dump`):

    $ svnadmin load /usr/local/svn/restored < repos-backup
    <<< Started new txn, based on original revision 1
         * adding path : test ... done.
         * adding path : test/a ... done.
    …

Or if you want to load into a subdirectory:

    $ svnadmin load --parent-dir new/subdir/for/project /usr/local/svn/restored < repos-backup
    <<< Started new txn, based on original revision 1
         * adding path : test ... done.
         * adding path : test/a ... done.
    …

#### svnadmin lstxns

Print the names of all uncommitted transactions.

##### Synopsis

    svnadmin lstxns REPOS_PATH

##### Description

Print the names of all uncommitted transactions. See for information on how uncommitted transactions are created and what you should do with them.

##### Examples

List all outstanding transactions in a repository.

    $ svnadmin lstxns /usr/local/svn/repos/
    1w
    1x

#### svnadmin recover

Recover any lost state in a repository.

##### Synopsis

    svnadmin recover REPOS_PATH

##### Description

Run this command if you get an error indicating that your repository needs to be recovered.

##### Examples

Recover a hung repository:

    $ svnadmin recover /usr/local/svn/repos/
    Acquiring exclusive lock on repository db.
    Recovery is running, please stand by...
    Recovery completed.
    The latest repos revision is 34.

#### svnadmin rmtxns

Delete transactions from a repository.

##### Synopsis

    svnadmin rmtxns REPOS_PATH TXN_NAME...

##### Description

Delete outstanding transactions from a repository. This is covered in detail in .

##### Switches

    --quiet (-q)

##### Examples

Remove named transactions:

    $ svnadmin rmtxns /usr/local/svn/repos/ 1w 1x

Fortunately, the output of svn lstxns works great as the input for rmtxns:

    $ svnadmin rmtxns /usr/local/svn/repos/  `svnadmin lstxns /usr/local/svn/repos/`

Which will remove all uncommitted transactions from your repository.

#### svnadmin setlog

Set the log-message on a revision.

##### Synopsis

    svnadmin setlog REPOS_PATH -r REVISION FILE

##### Description

Set the log-message on revision REVISION to the contents of FILE.

This is similar to using `svn propset --revprop` to set the `svn:log` property on a revision, except that you can also use the option `--bypass-hooks` to avoid running any pre- or post-commit hooks, which is useful if the modification of revision properties has not been enabled in the pre-revprop-change hook.

Revision properties are not under version control, so this command will permanently overwrite the previous log message.

##### Switches

    --revision (-r) ARG
    --bypass-hooks

##### Examples

Set the log message for revision 19 to the contents of the file `msg`:

    $ svnadmin setlog /usr/local/svn/repos/ -r 19 msg

#### svnadmin verify

Verify the data stored in the repository.

##### Synopsis

    svnadmin verify REPOS_PATH

##### Description

Run this command if you wish to verify the integrity of your repository. This basically iterates through all revisions in the repository by internally dumping all revisions and discarding the output.

##### Examples

Verify a hung repository:

    $ svnadmin verify /usr/local/svn/repos/
    * Verified revision 1729.

## `svnlook`

`svnlook` is a command-line utility for examining different aspects of a Subversion repository. It does not make any changes to the repository—it's just used for peeking. `svnlook` is typically used by the repository hooks, but a repository administrator might find it useful for diagnostic purposes.

Since `svnlook` works via direct repository access (and thus can only be used on the machine that holds the repository), it refers to the repository with a path, not a URL.

If no revision or transaction is specified, `svnlook` defaults to the youngest (most recent) revision of the repository.

### `svnlook` Switches

Switches in `svnlook` are global, just like in `svn` and `svnadmin`; however, most switches only apply to one subcommand since the functionality of `svnlook` is (intentionally) limited in scope.

`--no-diff-deleted`

  Prevents `svnlook` from printing differences for deleted files. The default behavior when a file is deleted in a transaction/revision is to print the same differences that you would see if you had left the file but removed all the content.

`--revision` (`-r`)

  Specify a particular revision number that you wish to examine.

`--transaction` (`-t`)

  Specify a particular transaction ID that you wish to examine.

`--show-ids`

  Show the filesystem node revision IDs for each path in the filesystem tree.

### `svnlook`

#### svnlook author

Print the author.

##### Synopsis

    svnlook author REPOS_PATH

##### Description

Print the author of a revision or transaction in the repository.

##### Switches

    --revision (-r)
    --transaction (-t)

##### Examples

`svnlook author` is handy, but not very exciting:

    $ svnlook author -r 40 /usr/local/svn/repos
    sally

#### svnlook cat

Print the contents of a file.

##### Synopsis

    svnlook cat REPOS_PATH PATH_IN_REPOS

##### Description

Print the contents of a file.

##### Switches

    --revision (-r)
    --transaction (-t)

##### Examples

This shows the contents of a file in transaction `ax8`, located at `/trunk/README`:

    $ svnlook cat -t ax8 /usr/local/svn/repos /trunk/README

                   Subversion, a version control system.
                   =====================================

    $LastChangedDate: 2003-07-17 10:45:25 -0500 (Thu, 17 Jul 2003) $

    Contents:

         I. A FEW POINTERS
        II. DOCUMENTATION
       III. PARTICIPATING IN THE SUBVERSION COMMUNITY
    …

#### svnlook changed

Print the paths that were changed.

##### Synopsis

    svnlook changed REPOS_PATH

##### Description

Print the paths that were changed in a particular revision or transaction, as well as an svn update-style status letter in the first column: `A` for added, `D` for deleted, and `U` for updated (modified).

##### Switches

    --revision (-r)
    --transaction (-t)

##### Examples

This shows a list of all the changed files in revision 39 of a test repository:

    $ svnlook changed -r 39 /usr/local/svn/repos
    A   trunk/vendors/deli/
    A   trunk/vendors/deli/chips.txt
    A   trunk/vendors/deli/sandwich.txt
    A   trunk/vendors/deli/pickle.txt

#### svnlook date

Print the datestamp.

##### Synopsis

    svnlook date REPOS_PATH

##### Description

Print the datestamp of a revision or transaction in a repository.

##### Switches

    --revision (-r)
    --transaction (-t)

##### Examples

This shows the date of revision 40 of a test repository:

    $ svnlook date -r 40 /tmp/repos/
    2003-02-22 17:44:49 -0600 (Sat, 22 Feb 2003)

#### svnlook diff

Print differences of changed files and properties.

##### Synopsis

    svnlook diff REPOS_PATH

##### Description

Print GNU-style differences of changed files and properties in a repository.

##### Switches

    --revision (-r)
    --transaction (-t)
    --no-diff-deleted

##### Examples

This shows a newly added (empty) file, a deleted file, and a copied file:

    $ svnlook diff -r 40 /usr/local/svn/repos/
    Copied: egg.txt (from rev 39, trunk/vendors/deli/pickle.txt)

    Added: trunk/vendors/deli/soda.txt
    ==============================================================================

    Modified: trunk/vendors/deli/sandwich.txt
    ==============================================================================
    --- trunk/vendors/deli/sandwich.txt	(original)
    +++ trunk/vendors/deli/sandwich.txt	2003-02-22 17:45:04.000000000 -0600
    @@ -0,0 +1 @@
    +Don't forget the mayo!

    Modified: trunk/vendors/deli/logo.jpg
    ==============================================================================
    (Binary files differ)

    Deleted: trunk/vendors/deli/chips.txt
    ==============================================================================

    Deleted: trunk/vendors/deli/pickle.txt
    ==============================================================================

If a file has a non-textual `svn:mime-type` property, then the differences are not explicitly shown.

#### svnlook dirs-changed

Print the directories that were themselves changed.

##### Synopsis

    svnlook dirs-changed REPOS_PATH

##### Description

Print the directories that were themselves changed (property edits) or whose file children were changed.

##### Switches

    --revision (-r)
    --transaction (-t)

##### Examples

This shows the directories that changed in revision 40 in our sample repository:

    $ svnlook dirs-changed -r 40 /usr/local/svn/repos
    trunk/vendors/deli/

#### svnlook help

##### Synopsis

    Also svnlook -h and svnlook -?.

##### Description

Displays the help message for svnlook. This command, like its brother `svn help`, is also your friend, even though you never call it anymore and forgot to invite it to your last party.

##### Alternate Names

?, h

#### svnlook history

Print information about the history of a path in the repository (or the root directory if no path is supplied).

##### Synopsis

    svnlook history REPOS_PATH
                [PATH_IN_REPOS]

##### Description

Print information about the history of a path in the repository (or the root directory if no path is supplied).

##### Switches

    --revision (-r)
    --show-ids

##### Examples

This shows the history output for the path `/tags/1.0` as of revision 20 in our sample repository.

    $ svnlook history -r 20 /usr/local/svn/repos /tags/1.0 --show-ids
    REVISION   PATH <ID>
    --------   ---------
          19   /tags/1.0 <1.2.12>
          17   /branches/1.0-rc2 <1.1.10>
          16   /branches/1.0-rc2 <1.1.x>
          14   /trunk <1.0.q>
          13   /trunk <1.0.o>
          11   /trunk <1.0.k>
           9   /trunk <1.0.g>
           8   /trunk <1.0.e>
           7   /trunk <1.0.b>
           6   /trunk <1.0.9>
           5   /trunk <1.0.7>
           4   /trunk <1.0.6>
           2   /trunk <1.0.3>
           1   /trunk <1.0.2>

#### svnlook info

Print the author, datestamp, log message size, and log message.

##### Synopsis

    svnlook info REPOS_PATH

##### Description

Print the author, datestamp, log message size, and log message.

##### Switches

    --revision (-r)
    --transaction (-t)

##### Examples

This shows the info output for revision 40 in our sample repository.

    $ svnlook info -r 40 /usr/local/svn/repos
    sally
    2003-02-22 17:44:49 -0600 (Sat, 22 Feb 2003)
    15
    Rearrange lunch.

#### svnlook log

Print the log message.

##### Synopsis

    svnlook log REPOS_PATH

##### Description

Print the log message.

##### Switches

    --revision (-r)
    --transaction (-t)

##### Examples

This shows the log output for revision 40 in our sample repository:

    $ svnlook log /tmp/repos/
    Rearrange lunch.

#### svnlook propget

Print the raw value of a property on a path in the repository.

##### Synopsis

    svnlook propget REPOS_PATH PROPNAME PATH_IN_REPOS

##### Description

List the value of a property on a path in the repository.

##### Alternate Names

pg, pget

##### Switches

    --revision (-r)
    --transaction (-t)

##### Examples

This shows the value of the seasonings property on the file `/trunk/sandwich` in the `HEAD` revision:

    $ svnlook pg /usr/local/svn/repos seasonings /trunk/sandwich
    mustard

#### svnlook proplist

Print the names and values of versioned file and directory properties.

##### Synopsis

    svnlook proplist REPOS_PATH PATH_IN_REPOS

##### Description

List the properties of a path in the repository. With `--verbose`, show the property values too.

##### Alternate Names

pl, plist

##### Switches

    --revision (-r)
    --transaction (-t)
    --verbose (-v)

##### Examples

This shows the names of properties set on the file `/trunk/README` in the `HEAD` revision:

    $ svnlook proplist /usr/local/svn/repos /trunk/README
      original-author
      svn:mime-type

This is the same command as in the previous example, but this time showing the property values as well:

    $ svnlook proplist /usr/local/svn/repos /trunk/README
      original-author : fitz
      svn:mime-type : text/plain

#### svnlook tree

Print the tree.

##### Synopsis

    svnlook tree REPOS_PATH [PATH_IN_REPOS]

##### Description

Print the tree, starting at PATH_IN_REPOS (if supplied, at the root of the tree otherwise), optionally showing node revision IDs.

##### Switches

    --revision (-r)
    --transaction (-t)
    --show-ids

##### Examples

This shows the tree output (with node-IDs) for revision 40 in our sample repository:

    $ svnlook tree -r 40 /usr/local/svn/repos --show-ids
    / <0.0.2j>
     trunk/ <p.0.2j>
      vendors/ <q.0.2j>
       deli/ <1g.0.2j>
        egg.txt <1i.e.2j>
        soda.txt <1k.0.2j>
        sandwich.txt <1j.0.2j>

#### svnlook uuid

Print the repository's `UUID`.

##### Synopsis

    svnlook uuid REPOS_PATH

##### Description

Print the `UUID` for the repository. the UUID is the repository's Universal Unique IDentifier. The Subversion client uses this identifier to differentiate between one repository and another.

##### Examples

    $ svnlook uuid /usr/local/svn/repos
    e7fe1b91-8cd5-0310-98dd-2f12e793c5e8

#### svnlook youngest

Print the youngest revision number.

##### Synopsis

    svnlook youngest REPOS_PATH

##### Description

Print the youngest revision number of a repository.

##### Examples

This shows the youngest revision of our sample repository:

    $ svnlook youngest /tmp/repos/
    42

## `svnserve`

`svnserve` allows access to Subversion repositories using the `svn` network protocol. You can run svnserve either as a standalone server process, or you can have another process, such as `inetd`, `xinetd` or `sshd`, launch it for you.

Once the client has selected a repository by transmitting its URL, `svnserve` reads a file named `conf/svnserve.conf` in the repository directory to determine repository-specific settings such as what authentication database to use and what authorization policies to apply. See for details of the `svnserve.conf` file.

### `svnserve` Switches

Unlike the previous commands we've described. `svnserve` has no subcommands—`svnserve` is controlled exclusively by switches.

`--daemon` (`-d`)

  Causes `svnserve` to run in daemon mode. `svnserve` backgrounds itself and accepts and serves TCP/IP connections on the svn port (3690, by default).

`--listen-port`=PORT

  Causes svnserve to listen on PORT when run in daemon mode.

`--listen-host`=HOST

  Causes `svnserve` to listen on the interface specified by HOST, which may be either a hostname or an IP address.

`--foreground`

  When used together with `-d`, this switch causes `svnserve` to stay in the foreground. This switch is mainly useful for debugging.

`--inetd` (`-i`)

  Causes `svnserve` to use the stdin/stdout file descriptors, as is appropriate for a daemon running out of `inetd`.

`--help` (`-h`)

  Displays a usage summary and exits.

`--root`=ROOT (`-r`=ROOT)

  Sets the virtual root for repositories served by `svnserve`. The pathname in URLs provided by the client will be interpreted relative to this root, and will not be allowed to escape this root.

`--tunnel` (`-t`)

  Causes `svnserve` to run in tunnel mode, which is just like the `inetd` mode of operation (serve one connection over stdin/stdout) except that the connection is considered to be pre-authenticated with the username of the current uid. This flag is selected by the client when running over a tunnel agent such as `ssh`.

`--threads` (`-T`)

  When running in daemon mode, causes `svnserve` to spawn a thread instead of a process for each connection. The `svnserve` process still backgrounds itself at startup time.

`--listen-once` (`-X`)

  Causes `svnserve` to accept one connection on the svn port, serve it, and exit. This option is mainly useful for debugging.