Copyright © 2004 Alexander Wintermans
Table of Contents
Joe (username joe) is using host jjj.joe.org (attached to the internet) to host a private repository of his source code.
Multi-user access will not be discussed here.
$ cd importRoot $ svn import . file:///home/joe/svn/rep1 --message 'Initial version'
Locally:
$ svn checkout file:///home/joe/svn/rep1/projectPath/trunk checkoutDestination
Remotely:
$ svn co svn+ssh://jjj.joe.org/home/joe/svn/rep1/projectPath/trunk \ checkoutDestination
$ svn proplist --verbose .or
$ svn proplist --verbose file:///home/joe/svn/rep1/path
In CVS there is a facility to group a number of directories into a module that can be checked out in one go. A similar effect can be achieved in subversion using the svn:externals property.
Here follow instructions for creating a module myModule that will check out directories A, B and C. Directory A will be checked out into ./root. Directory B will be checked out into ./root/sub. Directory C will be checked out into ./tools.
First create a module directory in the repository and check it out:
$ svn mkdir file:///home/joe/svn/rep1/modules/myModule $ svn co file:///home/joe/svn/rep1/modules/myModule latest_myModule $ cd latest_myModule
Then edit the svn:externals property for this directory:
$ svn propedit svn:externals .Enter the following lines:
root file:///home/joe/svn/rep1/A/trunk root/subdir file:///home/joe/svn/rep1/B/trunk tools file:///home/joe/svn/rep1/C/trunk
Check the result by updating.
$ svn updateYour directory should now populate.
Check in the new property value.
$ svn commit
TortoiseSVN is a graphical subversion client for Microsoft operating systems. It uses a modified version of Putty to enable SSH tunneling.
One of the problems using subversion with SSH is having to enter your password every time you run a subversion command. This can be fixed by using a private key to establish the SSH connection (instead of a password). Having generated a private key on the repository host and set up SSH in the normal way, the following procedure shows how to configure TortoiseSVN to use that key for accessing the repository.
Ensure that the Putty suite of tools is installed (TortoiseSVN only includes a hacked version of plink.exe).
Use puttygen.exe to convert the id.rsa private key file to a *.ppk putty-compatible file (e.g. joeOnJjj.ppk).
Add a line to the C:\Documents and Settings\joe\Application Data\Subversion\config file (also accessible throught the explorer context menu Main+ ). The line must be added to the [tunnels] section:
-> +jjj = C:\\Program Files\\TortoiseSVN\\TortoisePlink.exe -batch \ -i C:\\home\joe\\joeOnJjj.ppk -l joe
Now you can checkout without entering a password by entering a URL like:
svn+jjj://jjj.joe.org/home/joe/svn/rep1/projectPath/trunk
Using a private key for SSH connections is potentially risky if the client machine is not entirely secure. To limit damage to the repository host in case of compromise of your private key you can restrict that key's use to subversion. See the SSH notes' section on 'Restricting private-key-connections'.