svn: Syntax error parsing revision...

Apr 08, 2008 in Subversion, and Linux

When using svn+ssh:// to check out content from the root of a remote SVN repository, in many cases the user for the account you must login to on the remote server does not match the user of the currently active session on the local machine. This requires that the user be specified in the svn+ssh:// access attempt.

As an example, to checkout the trunk of my main repository at svn.d4ly.com, I would execute the following command through the shell

% svn co svn+ssh://jason@svn.d4ly.com/

Many times this throws the following error message

svn: Syntax error parsing revision 'svn.d4ly.com'

So SVN is attempting to retrieve the 'svn.d4ly.com' revision due to the presence of the @ symbol, which is an invalid revision name.

The Solution

The solution is to simply add a @ symbol to the end of the svn+ssh:// command.

% svn co svn+ssh://jason@svn.d4ly.com/@
% jason@svn.d4ly.com's password:

This now will properly attempt a connection via ssh to the remote SVN server as jason instead of the username of the current session on the local machine, properly checking out the HEAD revision.

Note: if a local directory is not specified, the co command will check out the contents of the repository to a jason@svn.d4ly.com directory inside of the current working directory. It's therefore a good idea to specify the local directory, even if it is just ..

% svn co svn+ssh://jason@svn.d4ly.com/@ ~/Desktop/Sites/d4ly.com/

D4Ly..com ©2006

Get in Touch

If you have any questions or comments, contacting me is simple.

  • AIM: jaSOn 7485
  • Xfire: d4ly
  • Gmail: jasondaly

Additionally, contact via email is always welcome.