O'Reilly logo

Version Control with Subversion, 2nd Edition by Brian W. Fitzpatrick, Ben Collins-Sussman, C. Michael Pilato

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Fetching Older Repository Snapshots

In addition to all of the previous commands, you can use svn update and svn checkout with the --revision option to take an entire working copy back in time:[7]

$ svn checkout -r 1729 # Checks out a new working copy at r1729
...
$ svn update -r 1729 # Updates an existing working copy to r1729
...

Tip

Many Subversion newcomers attempt to use the preceding svn update example to undo committed changes, but this won’t work as you can’t commit changes that you obtain from backdating a working copy if the changed files have newer revisions. See Resurrecting Deleted Items for a description of how to undo a commit.

Lastly, if you’re building a release and wish to bundle up your files from Subversion but don’t want those pesky .svn directories in the way, you can use svn export to create a local copy of all or part of your repository sans .svn directories. As with svn update and svn checkout, you can also pass the --revision option to svn export:

$ svn export http://svn.example.com/svn/repos1 # Exports latest revision
...
$ svn export http://svn.example.com/svn/repos1 -r 1729
# Exports revision r1729
...

[7] See? We told you that Subversion was a time machine.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required