Stats

52 Contributors: 4
2016-11-10
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook

Branching, shelving and tagging in Apache Subversion

Download svn eBook

Syntax

  • svn copy [BRANCH-FROM-URL] [BRANCH-TO-URL] -m <COMMIT-LOG-MESSAGE>

  • svn copy [^/PATH-TO-BRANCH-FROM] [^/PATH-TO-BRANCH-TO] -m <COMMIT-LOG-MESSAGE>

Remarks

As you might have noticed, we use svn copy command to create branches, tags and shelves (we'll skip mentioning tags and shelves in the next paragraphs). This is the same command used to copy items in your working copy and into the repository.

svn copy is used for branching because, branch is technically a copy of the source you copy from. However, this is not an ordinary copy are familiar with when copying files on your local file system. Branches in Subversion are so called "Cheap Copies" that are similar to symlinks. Therefore, creating a new branch takes minimal time to complete and takes practically no space in the Subversion repository. Create branches and use them for any change you want regardless of the change's size and scope.

svn copy can be shortened to svn cp as Subversion has aliases for most commands.

Related Examples