Command line svn on Ubuntu

This morning I had ‘some difficulties’ with the Eclipse IDE and Subversive to restore my code to an earlier version. Subversion is all about this, so this should be pretty easy…. right? It seemed to be ok, I right-clicked the PyDev project > Replace with > Revision or URL and filled in the revision number. Eclipse started to do something. When it was done, the revision numbers of the files I wanted to revert (which were newer than that revision) were still the same. Did it work? I don’t know. Talking about unexpected behaviour.. it prompts me if I really want to revert, but the revision number of the files stay the same.

As this was a good start of the morning which got me a little fed up, I decided to try the Subversion command line. For starters here’s the direct and fast outline to get to work quickly.

First install the Subversion package by typing

sudo apt-get install subversion

After installing you can use the svn command. To do a checkout of a project you can type

svn checkout [url of repository here] -r HEAD [the local location to place the files]

The above will do a checkout of the latest version of a repository url to a local url from an anonymous Subversion server. If authentication is required and you want a particular revision number the command will become

svn checkout [url of repository here] -r [revision number] --username [your username] [the local location to place the files]

You will then be prompted for your password. It’s also possible to pass this as an argument.
Of course this was a very very brief intro. There are many options with the svn command line. For more info on additional arguments and options you might want to take a look at this page and its previous page (they could have done the ordering better).

Getagged , , ,

Geef een reactie

Het e-mailadres wordt niet gepubliceerd. Vereiste velden zijn gemarkeerd met *