Subversion via SSH on Windows
So… You're behind a Windows machine, the project you're working on is managed through Subversion, and all the SVN admin said to you was
The URL is svn+ssh://svn.example.com and the username is user01. Make sure to first send me your pubkey.And there you are. Not a clue what all that means. What now?
Read on, and your SVN admin will never need to know what a newbie you are… ;)
- Premises
- Downloads
- PuTTY installatie
- TortoiseSVN installatie
- Genereren van een SSH sleutel
- Pageant
- TortoiseSVN
- Warning
Premises
While writing this HOWTO, I will assume:
- SVN is correctly installed and configured at the server (the repository)
- the repository's URL
svn+ssh://svn.example.com - your username is
user01 - you accept that I will not accept any responsibility for anything you do or don't do based on this manual
Downloads
First we'll need to download some things:
- PuTTY downloads
- Installer
- PuTTY
- Plink
- Pageant
- PuTTYgen
- TortoiseSVN downloads
- TortoiseSVN installer
PuTTY installation
If you've downloaded the installer, doubleclick it and the applications will be installed automatically, complete with icons in your startmenu.
If you've downloaded the separate applications, save them to a location that makes sense to you.
TortoiseSVN installation
The TortoiseSVN installation is started by doubleclicking the TortoiseSVN-*.msi.
After installing TortoiseSVN you'll need to reboot the PC, because that's how it works in Windows.
So make sure you've created a bookmark to this page.
When the PC has rebooted and you open Windows Explorer (which is not the same as Internet Explorer), you'll see that there are 2 new options in the right mouse menu: SVN Checkout and TortoiseSVN (a submenu). More about this later.
Generating an SSH keypair
First we'll need to generate an SSH key. Start PuTTYgen for this.
The PuTTYgen window consists of 3 fields: Key, Actions and Parameters. Funnily, the workflow is the exact opposite:
Parameters:
ForType of keyyou selectSSH-2 RSA; this means you'll be generating an RSA type key for SSH version 2. If you'd need another type of key, your SVN admin would have told you so.
Number of bitsdefines the size of the key; a larger key will give better encryption, but will also need more time for the encryption. My choice would be4096, but I'm a security freak;2048should suffice.Actions:
When you've filled in the parameters, press the button labeledGenerate.Key:
After some time, and some mouse movements to generate random data, your public key will be displayed in the field, including some input fields.
Give your email address as theKey comment; this will enable the SVN admin to recognize the key.
Type a passphrase for the key in theKey passphraseandConfirm passphrasefields.
(Yes, you will. I won't accept you saving an SSH key without a passphrase. That way you would open up the repository to the world; think of what could happen if your PC gets stolen, lost, dumped in the garbage, or whatever. You only need to type this passphrase once per session; I'll explain later.)
Now copy the contents of thePublic key for pasting into OpenSSH authorized_keys filefield and save this as a text file (e.g.user01_ssh_pubkey.txt).Actions:
Now press the buttons labeledSave public keyandSave private keyto save the generated keys; for this you could create a directorysshinMy Documents. The secret key will have a.ppkextension, for the public key the extension doesn't matter.
The file user01_ssh_pubkey.txt should now be mailed to your SVN admin, and you won't be able to continue until (s)he notified you that the key has been installed.
PuTTYgen may now be closed.
Pageant
Start Pageant; this will add an icon to your system bar. Rightclick this icon and select Add key; then select the private key you have just generated.
Pageant will now remember your key passphrase for you, so you won't need to type it over and over again.
Make sure Pageant starts when you start Windows; this could be accomplished by adding a shortcut to startmenu -> Programs -> Startup.
See the Pageant documentation to learn how to make Pageant load the keys when it starts.
TortoiseSVN
Open Windows Explorer, go to My Documents, create a new subdirectory named Development, open the new directory, rightclick and select SVN Checkout. Fill in these data in the window that opens:
- URL of repository:
svn+ssh://user01@svn.example.com/
Note: you type your username, followed by an at-sign, between the double slash and the rest of the URL. - Checkout directory: the name of the directory where you want the files saved
- Checkout depth:
Fully recursive - Revision:
HEAD revision
OK; the files will now be downloaded from the repository to your PC.
You can now edit the files like you're used to. The directory icons show which directories contain edited files; you can send these changes to the repository by rightclicking and then selecting SVN Commit (this will also work for entire directories, and only the actual changes will be transmitted).
You can update your version to the version in the repository by selecting SVN Update; do this regularly, especially if you're not the only one using this repository.
And that's it.
Subversion works, and you know how to get files from and to the repository.
The rest is left up to your Google capabilities.
Have fun,
Nerdstock.org
| Responses are welcomed: rob[at]nerdstock.org |
![]() http://creativecommons.org/licenses/by-nc-sa/3.0/nl/deed.en |







