Automating Subversion export on Windows

I was having problems using the a command line Subversion client on Windows XP to export from the repository. The problem was mainly my own stupidity but I’ll share the "solution" anyway.

The Subversion help describes the "export" command as follows:

export: Create an unversioned copy of a tree.
usage: 1. export [-r REV] URL[@PEGREV] [PATH]
       2. export [-r REV] PATH1[@PEGREV] [PATH2]

I mistakenly assumed that URL or PATH1 was required before the first path parameter. Alas, this is not the case and it took me a while to work out what I was doing wrong.

To export the HEAD of a path from the repository to a path on the C: drive you would use something like the following:

svn export svn://server/path c:\path –username stu
–password pwd –force

To export from the working copy to a path on the C: drive you would use something like the following:

svn export c:\workingcopy\path c:\path –username stu
–password pwd –force

Simple really. A bit like me.

Leave a Reply