After generating the RSA key in PuTTYgen

Setting up a Git client with SSH keys

As a developer, version control systems are one of the daily routines. Surprisingly there are a lot of people who does not know how to use them even though there are a lot of good tutorials out there. Today we are adding a new one, trying to explain the setup process as simple as possible. For now, we will stick to using Git with Windows and a GUI.

Start off by downloading the following files:

The installation proccess

To be sure, I’ll go through every program to make sure that everything gets set up correctly.

Installing Plink and puTTYgen

These programs have no installer, so simply place them in a directory that is not in your way, as you will at least need the Plink for later. The newer installations of TortoiseGit does not require these as they are included in the installer, so this is just mentioned to be sure.

Installing msysgit

A very straight forward install, select “Use Git Bash only” when asked for adjusting your PATH environment and make sure that you set the line endings to “Checkout Windows-style, commit Unix-style line endings” if someone in your team uses Linux. I would never recommend using the other ones, unless you are specifically told to do so or if you are running your Git server on a Windows machine. If you want to add the Windows Explorer integration, go ahead, but it is really not needed as we are using TortoiseGit for this instead.

Installing TortoiseGit

Only one thing to note here, you have to specify “TortoisePlink, coming from Putty” when choosing your SSH Client, OpenSSH will not work with SSH keys.

Creating your SSH key pair

Start up PuTTYgen, either from where you placed it or from the bin folder in your TortoiseGit installation directory if you got them through that installer. Press the Generate button and move your mouse over the grey area to create some randomness.

After generating the RSA key in PuTTYgen

After generating the SSH keys in PuTTYgen

Make sure that you save your private key as you will be needing this to connect to the Git server. Note that this is your private key, not to be shared by anyone! Now copy your public key (the key that is visible in the PuTTYgen window) and give it to your Git admin or if you are using GitHub, GitLab, etc, add it to your SSH keys under your Account Settings » SSH Keys.

Connecting to the Git server

So for the epic conclusion, connecting. Right click in any folder or on your desktop and select Git Clone.

Tortoise Git Clone window

Tortoise Git Clone window

Add the URL of the Git repository and change the directory if you please. Finally, select “Load Putty Key” and browse to your private SSH key that you saved earlier. Press OK and you are good to go!


Leave a Reply

Your email address will not be published. Required fields are marked *