Last modified 6 years ago Last modified on 05/20/14 15:29:42

We now are at github. Please visit us there:

How to work with the dCache internal SVN system

1. Creating an ssh key

If you don't have an ssh public key, generate one with the ssh-keygen command. For example:



ssh-keygen -t rsa -b 1024

You SHOULD give a non-blank, good pass-phrase when prompted for one.

By default, you will create two files in ~/.ssh. The file ending .pub is your ssh public key: you can send that to anyone. The one that does not end .pub is private, send that to noone.

2. Get access

Send your ssh public key and your preferred account name to support@…, requesting to be added or updated. We will only do this after your identity has been verified please also include like full telephone number, who you are, why you want access and when we can speak to you including your time zone.

3. Prepare your local environment

If your SVN account name is different from your local username, you can store the difference within your SSH configuration file ~/.ssh/config. The following is an example:

  User pmillar

If you have kerberos installed on your node, for some reason this interfears with the use of protocol 2. This has effected DESY and FERMI users, to resolve this, you must add the additional value to the configuration file.

Protocol 2

This should prevent you getting log in failures with just the password.

And example ~/.ssh/config is shown here.

	Protocol 2

then check out as

[root@ford oms]# svn co svn+ssh://
A  trunk/dcacheUpgrade
A  trunk/dcacheUpgrade/dcacheUpgrade_1_6-1_7
A  trunk/dcacheUpgrade/dcacheUpgrade_1_6-1_7/glite-dcache-upgrade.spec
A  trunk/dcacheUpgrade/dcacheUpgrade_1_6-1_7/src
A  trunk/dcacheUpgrade/dcacheUpgrade_1_6-1_7/src/

Not this allows you to work as multiple users sharing an account.

4. Configure an ssh-agent

The ssh-agent is a daemon process that stores your authentication credentials (you public/private key-pairs). When ssh attempt to log into a remote site, it will try all the identities within the ssh-agent. Since these are stored unlocked, this allows you to log in without having to type in your pass-phrase.

Starting ssh-agent

All modern GNU/Linux distributes now start an ssh-agent for your X session. You can test this by typing the following command; if it returns a blank line then you are not running an ssh-agent.


If you do not have ssh-agent running, you can start it with the following command:

eval `ssh-agent`

This will also create the necessary SSH_AUTH_SOCK environment variable, but only for your current shell (and it's children). To allow ssh-agent access elsewhere, simply copy the value of $SSH_AUTH_SOCK to that shell. For bash shell, the following command achieves this:

export SSH_AUTH_SOCK=/tmp/....

When you are finished, you should kill the ssh-agent using the following command:

eval `ssh-agent -k`

Uploading a key into ssh-agent

You should add you ssh key to an ssh-agent when using subversion. This allowing SVN interaction without having to type your pass-phrase.

You can see a list of all currently stored keys using the following command:

ssh-add -l

To add your key to the ssh-agent use the ssh-add command. When run without any arguments, it will add all keys with standard names. You can add specific ssh key by specifying the path as an argument to ssh-add.


SSH-agent command wrapping

Sometimes you might want to interact with subversion without loading your SSH key into an SSH agent. This might be because you don't trust the computer's security, or that you prefer to keep the manual step of typing the pass-phrase (giving you a chance to realise the mistake you're about to check into SVN).

If this is so, you might like to type the pass-phrase in, but only once. For certain operations (such as svn diff), the subversion client will contact the server multiple times. Typing in the pass-phrase for each connection can become tiresome.

One potential solution is to start a ssh-agent for this one command, then kill it after the command has complete. The saw script provides a simple wrapper around any command. Simply prepend saw to the command.

Installing SVN

SVN client is available on SL3 from CERN but not SL3 from Fermi since we in the dCache development team use SL3 Fermi, if you are using SL3 you may need to add the following file.

#cat /etc/apt/sources.list.d/cern.list 
rpm dag/redhat/el3/en/i386 dag

If you are using SL3 please type

 apt-get install subversion

for SL4 please type

yum install  subversion

5.0 Browsing SVN with a web browser

The dCache SVN is viewable of a web interface.

5.1 Checking code out of subversion

The following locations are defined for subversion:

Tools (Owen's)svn+ssh://


The following will create a directory dCache and check-out every branch, including the Trunk, underneath that directory. This may not be what you want. where USERNAME is set to your user name on the SVN server.

svn co svn+ssh://${USERNAME}

The following command will create the dCache-trunk directory. It will check-out just the dCache trunk, storing it within the directory.

svn co svn+ssh:// dCache-trunk

5.2 Checking code out of subversion as an anonymous user

The following locations are defined for read-only subversion access

Chimera ACLs
dCap (trunk)
dCache tools

tsmcp is a store/retrieve utility for Tivoli Storage Manager

NB You will want to add /trunk to most of these URLs to get only the trunk version.

A comparison table between CVS- and SVN-commands.

CVS commandSVN commandExample
cvs -d <repository> checkoutsvn <repository> checkout <local dir name>svn co svn+ssh:// dCache-Build # otherwise checked out directory will be called trunk
cvs cisvn cisvn ci
cvs cosvn <tag repository > co svn co svn+ssh://
cvs co -r <rev>svn co -r <rev>svn co -r <rev>
cvs co -r <tag>svn co svn co
cvs rmsvn rmsvn rm
cvs tagsvn copysvn copy svn+ssh:// svn+ssh://
cvs tag -Bsvn copysvn copy svn+ssh:// svn+ssh://
cvs tag -Bsvn mkdir
svn copy
svn mkdir svn+ssh://
svn copy svn+ssh:// svn+ssh://
cvs tag -d <tag>svn deletesvn delete svn+ssh://
cvs diffsvn diffsvn diff
-svn mvsvn mv
rm; cvs update # revert changessvn revertsvn revert


 svn merge  svn+ssh:// 

Merge into current workspace

svn merge -c 8913 svn+ssh:// modules/srm/src/org/dcache/srm 

Diff between two tags

svn diff svn+ssh:// 

Find the changed files between two revisions

svn diff --summarize -x -w  -r N:M

Find commits in single branch only

svn log --stop-on-copy svn+ssh://

Update Status

A Added

D Deleted

U Updated

C Conflicted

G Merged

A character in the first column signifies an update to the actual file, while updates to the file's properties are shown in the second column.


There is a plugin for NetBeans-5. Support for SVN is integrated into NetBeans-6.


There are two plugins to Eclipse that allow you to work with Subversion repositories: subversive and subclipse.

Both plugins use underlying Java SVN backends to do the actual work. There are two widely used backends: JavaHL and SVNKit.

With both plugins, SVNKit is the preferred option as it is pure Java whereas JavaHL uses native code via JNI to run. However, SVNKit does not support ssh-agents. To use keys stored in your ssh-agent within Eclipse, you must switch to JavaHL backend.

Both plugins are configured through the same method. Select Windows from the main menu, then select Preferences... This will open the preferences dialogue box. Open the Team part of the tree and select SVN. The right pane should show a configuration where you can select the SVN backend: either JavaHL or SVNKit.

Bear in mind that in order to use the JavaHL SVN-backend, you must install the corresponding JNI native library and configure Eclipse so its JVM has a java.library.path that includes the path to the JavaHL library.

Under Debian (and derivatives), the JNI library is packaged as libsvn-java (formally libsvn-javahl).

It is possible to configure eclipse to use a particular path by editing the file eclipse.ini, which is located in the root of distribution, adding a line like:


after the -vmargs line.

Further information

  • Last Modified : August 28,2007 by Owen
  • Last Modified : April 24,2007 by Patrick
  • Last Modified : November 8,2007 by Paul
  • Last Modified : June 06,2008 by Owen