SSH and WinCVS with Sourceforge.net Projects

I’ve been a member of the b2evo team for a long time now, but until today, I’ve never actually checked anything into the codebase.

There are a lot of SSH and CVS tutorials on the web, and in fact, there are many on SourceForge.net. However, I have yet to see one that’s simple, easy, and has everything you need, and is written for Windows users, so I decided to write one now that I’ve finally got it working.

Unfortunately, there is more information out there about SSH and CVS than there is actually explaining how to use SSH and CVS. Nevertheless, a bit of explanation is in order, just so that you’ll understand what I’m talking about.

SSH is an encryption protocol that uses a private/public asynchronous keypair. That is, there’s a public key that you give to the world, and a private key that you keep, well, private. The public key is used to encode data, and the private key is used to decode it. That way, someone can encrypt something with your public key, and you’re the only one who can open it. Also, you can assign a password to your private key - so, even if it is compromised, it’s still password protected. But, next to the security of the private key, a password is really nothing. The private key is much larger than the public key, and almost impossible to decipher.

CVS is a server-side versioning system for multiple people working on a project. It saves a copy of code files, along with all the changes in those files. That way, you can download particular versions, or analyze the differences between versions. Also, it can merge multiple changed files together, so if Bob is working on a file, Joe can be working on it at the same time, and their changes (probably) won’t conflict, because they’ll be merged together. (Otherwise, whoever saved the file first would lose their changes, because the next person would overwrite them.)

  1. Create an account on SourceForge, if you haven’t already.

  2. Get the project admin to add you to the project as a developer. Depending on the rules of the open source project that you’d like to contribute to, this may vary. For b2evolution, you need to talk to the man, FP.

  3. Download puttygen.exe. This is a program that you can use to generate an SSH public/private keypair. Run it.

    1. Select “SSH-2 DSA” in “Parameters”.

    2. Click “Generate”.

    3. Follow the instructions (Move the mouse over the blank area.)

    4. (Optional) Enter a password, and confirm it. You don’t have to do this, and it will be more convenient to use if you don’t, since you won’t have to enter a password, but it is significantly less secure, so if you don’t have the computer under lock and key, use a password.

    5. Enter your_SourceForge_username@cvs.sourceforge.net in the “Key Comment.”

    6. Save the public key and the private key.

  4. Get OpenSSH for windows and install it using the installer. Make a note of where you installed it. (The default is C:\Program Files\OpenSSH\.)

  5. Get WinCVS. There are a lot of CVS client programs out there, but WinCVS is the best that I’ve used.

  6. (Optional) Get WinMerge. You don’t need it, but WinMerge makes tracking changes much easier. CVS has a built-in merge/diff utility, but it’s command-line based, and pretty hard to look at. WinMerge puts the two files side-by-side and highlights the changed lines, letting you easily revert or make changes bit by bit. Very handy.

  7. Install WinCVS, and fire it up.

  8. Admin > Preferences

  9. Authentication: SSH

  10. Click on Settings

  11. RSA Private Key: Browse to the key file you made with puttygen.exe

  12. SSH Client: the ssh.exe file you installed. If you installed it in the default location, then it’s at C:\Program Files\OpenSSH\bin\ssh.exe. Click OK.

  13. path: /cvsroot/project_name. (In my case /cvsroot/evocms)

  14. Host address: cvs.sourceforge.net

  15. Username: your SourceForge username

  16. Click on the “WinCVS” tab, and select WinMerge as the external diff.

  17. When you do stuff in WinCVS, a command prompt will open up to have you input your password a bunch. (If this bugs you too much, then create a key with no passphrase, but this is much more insecure!)

  18. Click on the “CVS” tab, and select your “Home Directory”. This is the folder that is going to contain all of the code that you download from the CVS server. Click OK.

  19. Click on the “Change Location” button near the top of the screen, and go to your home directory.

  20. Right-click, “Checkout Module”

  21. Enter the module name on the CVS server. In my case, the module name is “b2evolution”, but this depends on the name of your project.

Assuming that you have permission to do so, you should be up and running and committing stuff quite deftly. Remember, each time you try to do something you’ll get a little command prompt popup. Just enter your SSH password (if you have one), and press Enter.

2 Responses to “SSH and WinCVS with Sourceforge.net Projects”

  1. On July 10th, 2005 at 10:12:45, Graham Said:

    Also remember that the cvs version of b2evo is completely unsupported, and you probably won’t be able to upgrade from it. If you stuff things up, you’re on your own!

  2. On August 30th, 2005 at 23:51:32, jyap Said:

    Step 8. Admin > Preferences

    OK, this works for version 1.2 of WinCVS. What about the latest and greatest version 2? Are there instructions for this version that you know of?

    Thanks.

Leave a Reply

Comments are moderated like crazy using a variety of plugins. There is a very high likelihood that your comment won't show up right away, especially if you have never commented here before, but it was not deleted.

Please be patient, and do not post your comment more than once. It will show up once it is approved.

You must be logged in to post a comment.