Version Control with Subversion, 2nd Edition
by C. Michael Pilato, Ben Collins-Sussman, Brian W. Fitzpatrick
Name
svn copy — Copy a file or directory in a working copy or in the repository.
Synopsis
svn copySRC[@REV]...DST
Description
Copy one or more files in a working copy or in the
repository. When copying multiple sources, they will be added as
children of DST, which must be a
directory. 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.
When copying multiple sources, they will be added as children
of DST, which must be a directory.
If no peg revision (i.e., @REV) is
supplied, by default the BASE
revision will be used for files copied from the working copy,
whereas the HEAD revision will be
used for files copied from a URL.
Note
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
Yes, if source or destination is in the repository, or if needed to look up the source revision number.
Options
--editor-cmdEDITOR--encodingENC--file (-F)FILE--force-log --message (-m)TEXT--parents --quiet (-q) --revision (-r)REV--with-revpropARG
Examples
Copy an item within your working copy (this schedules the copy—nothing goes into the repository until you commit):
$ svn copy foo.txt ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access