How to Setup Git with PuTTY and Pageant (My Way...)

How to Setup Git with PuTTY and Pageant (My Way...)

August 30, 2022
Git, PuTTY, Ssh

This is a short guide how to setup Git SSH access using PuTTY.

1. Install PuTTY #

PuTTY installer

2. Generate a public/private key using PuTTYgen #

PuTTYGen window
Saving the private key saves both the public and the private key in a *.PPK file.
Bonus Hint 1: Saving keys in Microsoft OneDrive or another cloud folder makes them easily available on any computer.

Do not close the PuTTYgen window yet.

3. Add public key to your Git provider #

The following screen captures are for GitHub but the process is similar for Bitbucket or other providers.

In your account settings, go to “SSH and GPG keys” and select “New SSH Key”

Add new key to GitHub

Copy the public key from the PuTTYgen window to the GitHub window:

Paste PuTTYGen key

Now your list of SSH keys should contain the newly added key:

New key added to GitHub
Bonus Hint 2: If you don’t want to save your keys with a cloud provider you can create separate key for each computer and add them all to your Git account.

You can now close the PuTTYgen window.

4. Load Pageant keys at startup #

Add a shortcut to Pageant to your startup folder. Hit Win + R and type “shell:startup” in the Run Dialog:

Open startup folder
In the startup folder create a shortcut to pageant.exe

Change the startup folder to the folder where you saved the *.ppk file and add the name of the key file to the command line. If you have more than one key to load, separate file names with spaces:

Pageant shortcut window

5. Install Git #

These screen captures are just those where I changed settings from their default values. Not all those changes are required but most are nice to use.

Git installer - Select Components
Git installer - Choose default editor
Git installer - Adjust name of initial branch

Now, this one is important:

Git installer - Choose SSH executable

6. Test #

Check that you can clone a repository (any repository will do):

Sample clone operation