Linux Subversion Version Control

svn checkout / update with custom key

SVN_SSH="ssh -i <path_to_key>" <svn_command>

for example:
SVN_SSH="ssh -i id_ecdsa_foobar" svn up

Linux MAC OS X

svn: Can’t convert string from ‘UTF-8’ to native encoding:

"svn: Can't convert string from 'UTF-8' to native encoding:"

This usually happens with special characters in the file name, which the client cannot understand.

Just set proper locale in the client to fix this issues,

$ export LC_CTYPE=en_US.UTF-8
// make sure the locale is properly set.
$ locale



svn+ssh with custom port number and public key authentication

To make custom configurations for svn+ssh:

Edit ~/.subversion/config

– add the ssh configuration details under [tunnels]
foobar = /usr/bin/ssh -i /home/foo/.ssh/foobar.private -p 12345

Now use:
svn co svn+foobar://


create svn repository and initial check in

To create svn repository login to the svn server:

$ sudo -u svnuser svnadmin create --fs-type fsfs /path/to/repository
* we can use bdb as well as db format

To make all the group members privilege to write access the repository:

$chmod g+w /path/to/repository

and add the user to svn group.

To create initial contents:
either you can check out the repository and create the file structure like:

[local_machine]$ svn co svn+ssh://user@svnhost/path/to/repos localdirectory
[local_machine]$ mkdir -p localdirectory/trunk localdirectory/tags localdirectory/branches
[local_machine]$ cd localdirectory; svn commit -m "initial repository structure"

or you can do the same from the svn server itself using file:///


Recover svn repository

It is normal that svn db get crashed because of permission issue. The following steps help to fix it.

chown svnuser:svngroup /path/to/repos
find /path/to/repos -type d -print0 -exec chmod 2775 {} \;
find /path/to/repos -type f -print0 -exec chmod 0664 {} \;
svnadmin recover /path/to/repos