svn
SVN 1.10+Quick reference for Subversion (SVN) commands: checkout, update, commit, branch/tag, merge, history inspection and repository administration, with common options and practical examples.
28 commands
Getting Started
svn checkout <url> [<dir>]Check out a working copy from a repository; the first time you fetch project files.
-r <rev> specific revision; --depth empty|files|immediates|infinity
svn checkout https://svn.example.com/repo/trunk ./my-projectsvn infoShow working copy or URL info: URL, revision, last-modified, etc.
svn info .Everyday Work
svn updateBring your working copy in sync with the repository; may merge server changes.
-r <rev> update to a specific revision; --accept postpone|base|mine-full|theirs-full|edit|launch
svn update --accept postponesvn statusShow working copy status: modifications, additions, deletions, untracked files.
-u show server out-of-date info; -v verbose; --quiet suppress untracked
svn status -usvn add <path>Schedule a file or directory to be added on the next commit.
-N non-recursive (directory only); --force add already-versioned
svn add src/utils/ helpers/svn delete <path>Remove a file or directory from the working copy and schedule deletion on the next commit.
--keep-local keep the file in working copy (no removal on server)
svn delete obsolete/old-config.jsonsvn commit -m "<msg>"Send local changes to the repository with a log message.
-m inline message; -F <file> read message from file; --no-unlock keep locks
svn commit -m "feat: add login form validation"svn diffShow unified diff between paths or revisions.
-r <rev1>:<rev2> compare revisions; -c <rev> changes made in a revision; --diff-cmd / -x
svn diff -r HEAD~5:HEAD --summarizesvn revert <path>Discard local edits and restore the file/directory to its pristine state.
-R recursive; --depth infinite
svn revert -R .Branching & Tags
svn copy <src> <dst>Create a branch or tag by copying in the repository (cheap copy).
-r <rev> copy from a specific revision; -m message
svn copy ^/trunk ^/branches/feature-x -m "branch: feature-x"svn switch <url>Switch the working copy to point at a different branch/tag without re-checking out.
-r <rev> switch to a specific revision; --relocate rewrite URL prefix
svn switch ^/branches/feature-xsvn list <url>List entries in a repository directory without checking them out.
-v verbose; -r <rev>
svn list -v ^/tags/Merging & Conflict
svn merge <url[@rev]>Apply the differences between two sources/branches into your working copy.
-c <rev> / -r <rev1>:<rev2> revisions to merge; --record-only merge tracking only
svn merge ^/trunk -c 12345svn merge --reintegrate <url>Reintegrate a feature branch back into its source branch (legacy, pre-1.8).
svn merge --reintegrate ^/branches/feature-xsvn resolve <path>Resolve conflicted files after a merge/update.
--accept base|mine-full|theirs-full|working|theirs-conflict|theirs-full
svn resolve --accept theirs-full conflict.txtHistory & Inspect
svn logShow commit log messages for files or the repository.
-r <rev1>:<rev2> range; -l <n> limit; -v verbose paths; --xml
svn log -l 20 -vsvn blame <file>Show the author and revision for each line in a file (praise / annotate).
-r <rev> annotate as of revision; -v include revision text
svn blame src/index.ts | tail -20svn cat <url>[@rev]Show the contents of a file at a given URL/revision without checking it out.
svn cat ^/trunk/README.md@HEADProperties & Locks
svn propset <prop> <value> <path>Set a property on a file or directory (e.g., svn:ignore, svn:executable, svn:mime-type).
-F <file> value from file; --revprop repository revprop
svn propset svn:ignore "node_modules\n.DS_Store" .svn propedit <prop> <path>Open the property value in an editor to change it.
svn propedit svn:ignore .svn lock <target>Lock files so no other client can commit changes (requires server config).
-m "reason"; --force steal lock
svn lock images/banner.png -m "editing before release"svn unlock <target>Release a lock on a file or directory.
--force break another's lock
svn unlock images/banner.pngRepository & Cleanup
svn cleanupClean up the working copy: remove lock tokens, fix timestamp, complete pending ops.
--diff3-cmd / --remove-unversioned untracked cleanup
svn cleanup /path/to/wcsvn export <url> [<dir>]Export a clean directory tree (without .svn metadata) — useful for packaging.
-r <rev> specific revision; --force overwrite existing
svn export ^/tags/v1.2.0 ./release-1.2svn import <path> <url> -m "<msg>"Add an unversioned tree to the repository as a single initial commit.
--no-ignore include ignored files; --auto-props apply auto-props
svn import ./src ^/trunk -m "initial import"svn relocate <from-prefix> <to-prefix>Rewrite the repository URL prefix stored in the working copy (server moved).
--strict reject non-matching prefix
svn relocate https://old.svn.example.com https://new.svn.example.comPatch
svn diff > patch.diffProduce a unified diff suitable for sharing or applying with svn patch.
svn diff > /tmp/feature-x.patchsvn patch <patch-file>Apply a unified diff generated by svn diff to the working copy.
--dry-run preview; --reverse-cmd
svn patch --dry-run /tmp/feature-x.patchRelated command cheatsheets
Trademark & Use Notice
These command-line tool cheatsheets are open community references. The names, logos, and trademarks of the tools referenced here (such as Git™, Docker™, Kubernetes®, kubectl, PostgreSQL®, MySQL®, Redis™, MongoDB®, Linux™, PowerShell™, Vim™, and others) are the property of their respective owners and are used here solely for identification and reference purposes.
All content in these cheatsheets is independently authored as a simplified, self-contained reference. It is not affiliated with, endorsed by, or sourced from any official documentation. Command listings, flag descriptions, and examples are original simplifications; for authoritative information please consult the official documentation of each tool.
Command syntax and option flags may differ across tool versions. The version tags shown reflect stable releases; behavior may differ in other versions. This cheatsheet does not imply any preference or recommendation by the trademark holders.
If a trademark or copyright owner believes that any content on this site infringes their rights, please send an email to [email protected]. Upon receiving valid proof of rights, we will modify or remove the relevant content within a reasonable period.
This website assumes no legal liability for any direct or indirect losses arising from the use of information presented on these pages.
About Apache Subversion
Apache Subversion (often abbreviated SVN) is an open-source centralized version control system first released by CollabNet in 2000 and now stewarded by the Apache Software Foundation. SVN keeps a single canonical history on a server (commonly served via Apache HTTP or `svnserve`) and tracks changes as revision numbers that monotonically increase per repository, in contrast to Git's content hashes. The current line is Subversion 1.14+. SVN models a repository as a filesystem tree with three back-end formats (FSFS being the default since 1.4), supports cheap branching via directories, atomic commits, properties for metadata, external references for shared components, and merge tracking since 1.5. It is widely used in enterprise settings, government, and game / media studios where a central authoritative history and fine-grained path-based access control matter more than offline branching. Use it when your organization mandates centralized VCS, you need to version huge binary assets with locking, or you are maintaining legacy code that still lives in an SVN repo. SVN over plaintext HTTP is unencrypted; in production always run it over HTTPS or `svn+ssh`.
Cheatsheet version 1.0.0