Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




Version Control with Subversion
Prev Home Next

Version Control with Subversion - svn copy


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


svn copy SRC DST


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).


Immediately commit a copy of WC to URL.


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


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



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.


--message (-m) TEXT
--file (-F) FILE
--revision (-r) REV
--quiet (-q)
--username USER
--password PASS
--editor-cmd EDITOR
--encoding ENC
--config-dir DIR


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.

[an error occurred while processing this directive]
Version Control with Subversion
Prev Home Next

  Published under the terms of the Creative Commons License Design by Interspire