295

I want to know if my server is running Subversion 1.5.

How can I find that out?

Also would be nice to know my SVN client version number. svn help hasn't been helpful.

Note: I don't want my project's revision number, etc. This question is about the Subversion software itself.

Peter Mortensen
  • 28,342
  • 21
  • 95
  • 123
  • A repository is not automatically updated unless the administrator runs 'svnadmin upgrade'. To be sure of the version number of the repository, check the 'format' file. See [@bdumitriu's answer on another question](https://stackoverflow.com/questions/282460/how-to-find-out-subversion-repository-version/282484#282484). – icasimpan Mar 30 '11 at 03:22

15 Answers15

213

To find the version of the subversion REPOSITORY you can:

  1. Look to the repository on the web and on the bottom of the page it will say something like:
    "Powered by Subversion version 1.5.2 (r32768)."
  2. From the command line: <insert curl, grep oneliner here>

If not displayed, view source of the page

<svn version="1.6.13 (r1002816)" href="http://subversion.tigris.org/"> 

Now for the subversion CLIENT:

svn --version

will suffice

Community
  • 1
  • 1
136

Let's merge these responses:

For REPOSITORY / SERVER (the original question):

If able to access the Subversion server:

  • From an earlier answer by Manuel, run the following on the SVN server:

    svnadmin --version
    

If HTTP/HTTPS access:

  • See the "powered by Subversion" line when accessing the server via a browser.

  • Access the repository via browser and then look for the version string embedded in the HTML source. From earlier answers by elviejo and jaredjacobs. Similarly, from ??, use your browser's developer tools (usually Ctrl + Shift + I) to read the full response. This is also the easiest (non-automated) way to deal with certificates and authorization - your browser does it for you.

  • Check the response tags (these are not shown in the HTML source), from an earlier answer by Christopher

    wget -S --spider 'http://svn.server.net/svn/repository' 2>&1 |
    sed -n '/SVN/s/.*\(SVN[0-9\/\.]*\).*/\1/p'
    

If svn:// or ssh+svn access

If GoogleCode SVN servers

    Check out the current version in a FAQ: 
    http://code.google.com/p/support/wiki/SubversionFAQ#What_version_of_Subversion_do_you_use?

If another custom SVN servers

    TBD

Please edit to finish this answer

For CLIENT (not the original question):

svn --version
Community
  • 1
  • 1
Lars Nordin
  • 2,492
  • 1
  • 19
  • 23
  • This answer is not clear that `svnserve --version` must be used on the server. If it's run on the client, it gives the version number of the client, not the server. – Craig McQueen Aug 18 '14 at 23:35
  • This is a good collection. I made it by the way of "read the full response from http/https access". In my case I can see one line in response header: – Tatera Nov 20 '14 at 02:41
  • In case somebody is using Visual SVN Server, the first few lines of HTML source ( right click, view Page Source ) will indicate the SVN version. – Raptor Mar 04 '16 at 07:35
  • This answer is [being discussed on Meta](http://meta.stackoverflow.com/q/335468/4751173). – Glorfindel Sep 29 '16 at 05:52
70

On the server: svnserve --version

in case of svnserve-based configuration (svn:// and svn+xxx://).

(For completeness).

Milen A. Radev
  • 54,001
  • 19
  • 99
  • 105
  • As Joe J mentions below, I believe this will just give you the version of the svnserve client program which will most likely match the svn client program – Kirby Oct 28 '11 at 23:45
  • 12
    `svnserve` is not a client programme, it's the server. And you have to type the command above when you're on the server. – Milen A. Radev Oct 29 '11 at 13:11
48

Here's the simplest way to get the SVN server version. HTTP works even if your SVN repository requires HTTPS.

$ curl -X OPTIONS http://my-svn-domain/
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>...</head>
<body>...
<address>Apache/2.2.11 (Debian) DAV/2 SVN/1.5.6 PHP/5.2.9-4 ...</address>
</body>
</html>
Peter Mortensen
  • 28,342
  • 21
  • 95
  • 123
jaredjacobs
  • 3,695
  • 1
  • 24
  • 21
24

For an HTTP-based server there is a Python script to find the server version at: http://svn.apache.org/repos/asf/subversion/trunk/tools/client-side/server-version.py

You can get the client version with

`svn --version`
Peter Mortensen
  • 28,342
  • 21
  • 95
  • 123
PiedPiper
  • 5,377
  • 1
  • 27
  • 38
  • 5
    Unless I am mistaken, it looks like that script only works with http or https based servers, and not svn or ssh+svn servers – crashmstr Sep 26 '08 at 19:42
  • If it's ssh based just ssh into the box and run "svn --version". – John Meagher Sep 26 '08 at 21:20
  • 5
    'svn --version' on the server only gives you the client version running on the server, it might not necessarily be the same as the server version – PiedPiper Sep 26 '08 at 22:54
  • 1
    That script also requires ServerTokens Full to be set on the Apache server. It will fail for the same servers that the curl solution will fail on. – yam655 Sep 08 '11 at 17:01
24

If the Subversion server version is not printed in the HTML listing, it is available in the HTTP RESPONSE header returned by the server. You can get it using this shell command

wget -S --no-check-certificate \
  --spider 'http://svn.server.net/svn/repository' 2>&1 \
  | sed -n '/SVN/s/.*\(SVN[0-9\/\.]*\).*/\1/p';

If the SVN server requires you provide a user name and password, then add the wget parameters --user and --password to the command like this

wget -S --no-check-certificate \
  --user='username' --password='password' \
  --spider 'http://svn.server.net/svn/repository' 2>&1 \
  | sed -n '/SVN/s/.*\(SVN[0-9\/\.]*\).*/\1/p';
Christopher
  • 1,776
  • 15
  • 15
  • 4
    I tried all other options on this page, with curl and from the URL and this is so far the only one that worked for me - server is freebsd, server 1.6.16. – ideasman42 Jul 14 '11 at 10:16
  • Likewise this is the only answer that worked for me amongst all the answers here. I used Firefox Live HTTP Headers and to read the response of the server because I was also having ssl certificate problems that I didn't feel like going to the trouble to figure out. Thank you, Christopher – Kirby Oct 28 '11 at 23:46
  • 1
    @Kirby I've added a `--no-check--certificate` parameter, a `--user` and `--password` to handle servers that require credentials but don't have a valid ssh certificate. This is pretty common as you noted. – Christopher Mar 15 '13 at 00:21
  • 1
    @Christopher it should read ''wget --password='password' .. | .. ;' above. – wh81752 Jan 04 '16 at 13:47
  • @whaefelinger thanks for the correction. I've updated the answer. – Christopher Sep 29 '16 at 02:23
  • Works for CollabNet/SVN 1.9.1 – Michael P Dec 11 '18 at 17:22
8

One more option: If you have Firefox (I am using 14.0.1) and a SVN web interface:

  • Open Tools->Web Developer->Web Console on a repo page
  • Refresh page
  • Click on the GET line
  • Look in the Response Headers section at the Server: line

There should be an "SVN/1.7.4" string or similar there. Again, this will probably only work if you have "ServerTokens Full" as mentioned above.

Conrad
  • 1,982
  • 24
  • 44
  • Thanks. I just did a similar thing in Chrome for a VisualSVN server by opening up the Network tab in the Developer Tools window (press F12 to access this), and then inspecting the response. – XåpplI'-I0llwlg'I - Feb 04 '13 at 12:01
  • Update: click on the Network tab in the Tools pane before refreshing page (currently Firefox 30) – Conrad Jul 08 '14 at 13:36
7

There really isn't an easy way to find out what version of Subversion your server is running -- except to get onto the server and see for yourself.

However, this may not be as big a problem as you may think. Subversion clients is were much of the grunt work is handled, and most versions of the Subversion clients can work with almost any version of the server.

The last release where the server version really made a difference to the client was the change from release 1.4 to release 1.5 when merge tracking was added. Merge tracking had been greatly improved in version 1.6, but that doesn't really affect the interactions between the client and server.

Let's take the latest changes in Subversion 1.8:

  • svn move is now a first class operation: Subversion finally understands the svn move is not a svn copy and svn delete. However, this is something that the client handles and doesn't really affect the server version.
  • svn merge --reintegrate deprecated: Again, as long as the server is at version 1.5 or greater this isn't an issue.
  • Property Inheritance: This is another 1.8 release update, but this will work with any Subversion server -- although Subversion servers running 1.8 will deliver better performance on inheritable properties.
  • Two new inheritable properties - svn:global-ignores and svn:auto-props: Alas! What we really wanted. A way to setup these two properties without depending upon the Subversion configuration file itself. However, this is a client-only issue, so it again doesn't matter what version of the server you're using.
  • gnu-agent memory caching: Another client-only feature.
  • fsfs performance enhancements and authz in-repository authentication. Nice features, but these work no matter what version of the client you're using.

Of all the features, only one depends upon the version of the server being 1.5 or greater (and 1.4 has been obsolete for quite a while. The newer features of 1.8 will improve performance of your working copy, but the server being at revision 1.8 isn't necessary. You're much more affected by your client version than your server version.

I know this isn't the answer you wanted (no official way to see the server version), but fortunately the server version doesn't really affect you that much.

David W.
  • 98,713
  • 36
  • 205
  • 318
7

Try this:

ssh your_user@your_server svnserve --version

svnserve, version 1.3.1 (r19032)
   compiled May  8 2006, 07:38:44

I hope it helps.

Peter Mortensen
  • 28,342
  • 21
  • 95
  • 123
ejaenv
  • 1,567
  • 18
  • 24
4

For a svn+ssh configuration, use ssh to run svnserve --version on the host machine:

$ ssh user@host svnserve --version

It is necessary to run the svnserve command on the machine that is actually serving as the server.

Glenn
  • 49
  • 1
  • 1
    this assumes you can ssh to the server. It is common to configure an svn+ssh server with a public key in authorized_keys file and command=svnserve which automatically starts svnserver without the --version option. – jrwren Mar 16 '12 at 13:38
2

Browse the repository with Firefox and inspect the element with Firebug. Under the NET tab, you can check the Header of the page. It will have something like:

Server: Apache/2.2.14 (Win32) DAV/2 SVN/1.X.X
Peter Mortensen
  • 28,342
  • 21
  • 95
  • 123
Jason H
  • 21
  • 1
  • 1
    Tried this with my subversion server and don't see the version. Looking at other posts that are similar it sounds like not all subversion servers support this particular way of determining the server version number. – Joshua Oct 12 '12 at 01:32
2

Just use a web browser to go to the SVN address. Check the source code (Ctrl + U). Then you will find something like in the HTML code:

<svn version="1.6. ..." ...
Peter Mortensen
  • 28,342
  • 21
  • 95
  • 123
N0thing
  • 5,249
  • 3
  • 17
  • 15
1

For Subversion 1.7 and above, the server doesn't provide a footer that indicates the server version. But you can run the following command to gain the version from the response headers

$ curl -s -D - http://svn.server.net/svn/repository
HTTP/1.1 401 Authorization Required
Date: Wed, 09 Jan 2013 03:01:43 GMT
Server: Apache/2.2.9 (Unix) DAV/2 SVN/1.7.4

Note that this also works on Subversion servers where you don't have authorization to access.

mettkea
  • 11
  • 1
1

You can connect to your Subversion server using HTTP and find the version number in the HTTP header.

Peter Mortensen
  • 28,342
  • 21
  • 95
  • 123
eaubin
  • 644
  • 9
  • 14
-1

If you use VisualSVN Server, you can find out the version number by several different means.

Use VisualSVN Server Manager

Follow these steps to find out the version via the management console:

  1. Start the VisualSVN Server Manager console.
  2. See the Version at the bottom-right corner of the dashboard.

enter image description here

If you click Version you will also see the versions of the components.

enter image description here

Check the README.txt file

Follow these steps to find out the version from the readme.txt file:

  1. Start notepad.exe.
  2. Open the %VISUALSVN_SERVER%README.txt file. The first line shows the version number.

enter image description here

bahrep
  • 26,679
  • 12
  • 95
  • 136