Using Tortise with cs.scotnpatti.com

Setting Up TortoiseSVN on your Machine

(See utube video at: http://www.youtube.com/watch?v=427Nkgfpk0w)

TortoiseSVN is a popular graphical Subversion client available for Windows, however when running TortoiseSVN against the svn+ssh protocol there is a major gotcha, TortoiseSVN promts you for your username and password on every action. From the start here is a solution:

First, download and install Putty, PuttyGen and PageAnt.

Second, logon to the box where your subversion repository is located and run the following set of commands (output included):

    $ ssh-keygen -b 1024 -t dsa -f mykey
    Generating public/private dsa key pair.
    Enter passphrase (empty for no passphrase):
    Enter same passphrase again:
    Your identification has been saved in mykey.
    Your public key has been saved in mykey.pub.
    The key fingerprint is:
    $ ls
    mykey mykey.pub
    $ mkdir .ssh
    $ cp mykey.pub .ssh/authorized_keys
    $ cat mykey
    —–BEGIN DSA PRIVATE KEY—–

Copy paste the output of the cat command into a text file on your local computer and save it.

Startup puttygen, select “load” the key you just saved, then choose “save private key” and save the resulting key into a location of your choice.

Setting to Use TortoiseSVN

Startup Pageant, it should turn up in the bar close to the clock (one of those background apps), choose import, and import the key you chose in the previous action.

You should now be able to fire up TortoiseSVN, another gotcha is that your URL in TortoiseSVN should be according to the pattern svn+ssh://[yourusename]@[server]/[pathToRepo]. What happens now is that TortoiseSVN will use the login credentials saved in Pageant on login, and thus avoid prompting for username and/or password. A final gotcha with this is that you need to fire up Pageant and import the key every time you start your computer. You can avoid this by firing up regedit and go to somewhere like:

My Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

Add a REG_SZ variable, named pageant, with the value first being the complete filepath of pageant.exe (remember to put “quotes” around things if there are any spaces in the path) and the complete filepath of the ppk file (likewise with the “quotes”).

If your ppk file is password protected, you’ll just be greeted automatically on starting up / logging in with putty asking you for your password once. If your ppk file isn’t password protected (less secure of course, but simpler in this case) I think you can completely forget about it from then on after and it’ll just work.

--OR--

If you want your .ppk file to be password protected, but don't want to be bugged with a passphrase entry box every time you log in to your computer, a program called AutoHotKey may be able to help you.

  1. Download AutoHotKey and install it.

  2. Click on Start->All Programs and Right click on Startup.

  3. Click open.
  4. Right click in the new explorer window and click on New->AutoHotkey Script.

  5. Give it a name (mine is pageanthelper).
  6. Right click on your new script and choose Edit Script.
  7. Add the following code to the bottom of the script:

Run "C:\Program Files\PuTTY\pageant.exe" "(path to .ppk file)"
WinWait Pageant: Enter Passphrase
WinActivate
Send (your passphrase){enter}
  1. Save the file and exit notepad.

The issue with this is that your passphrase is now stored in plain text. This can present a security issue if others have access to your computer. To solve this you need to do the following.

  1. Click Start->All Programs->Startup

  2. Right click pageanthelper (or whatever you named your script).
  3. Click Compile script.
  4. Right click your old script.
  5. Click delete (this is necessary so that it doesn't run twice when you log in).

TortoiseSvn (last edited 2010-03-08 18:27:22 by scot-office2)