After installing Git and TortoiseGit for use with GitHub on my home pc, I was hooked. But for some reason, the same thing wouldn’t work on my pc at work.
This seems to have something to do with Windows not playing well with Gits authentication system.
However, I’ll try to do my best and explain here how you can resolve this issue, to get you back up and running.
Note: in this tutorial, I’m using an SSH key with a passphrase. This causes the used applications to ask for the passphrase during the tutorial and once each time you log in to Windows. If you don’t want to enter a passphrase each login, you can choose to use a SSH key without a passphrase. This will be less secure, anyone who has your key can use it to access your repository.
The first step is to install PuTTY and its related applications, from the putty homepage. Install at least PuTTYGen and Pageant, we’ll need those later on.
Once you’ve installed the PuTTY tools, start PuTTYGen and load your private key via Conversions -> Import key. Your private key will be located at one of the following locations:
Windows XP: C:\Documents and Settings[username].ssh
Windows Vista/7: C:\Users[username].ssh
If you have a SSH key with a passphrase, you will be prompted to enter it now.
Once the key is loaded, save the private key as id_rsa.ppk, in the same folder as the other keys. This is basically the same key as the one you loaded, but in PuTTY’s format.
Copy the public key from the textbox, entitled ‘Public key for pasting into OpenSSH authorized_keys file:’. Go to your GitHub page and open 'SSH Keys’ under 'Account Settings’ and add the key there.
We’re done with PuTTYGen, now it’s time to make the key load at login. Add a shortcut to Pageant in your Startup folder.
Open the properties of the shortcut and edit the target path. Append the path to the private key we just created. The full path should look something like this:
Windows XP: “C:\Program Files\PuTTY\pageant.exe” “C:\Documents and Settings[username].ssh\idrsa.ppk”
Windows Vista/7: “C:\Program Files\PuTTY\pageant.exe” “C:\Users[username].ssh\idrsa.ppk”
Close the properties window and start Pageant using the same shortcut. If all went well and if you’re using a key with passphrase, you should be prompted to enter it now.
To verify we’ve done everything right, open up Pageant using the icon in the taskbar, by double clicking it or right click -> View keys. This will open a list with all loaded keys, which in our case is only one.
That’s it! If the key is loaded, we can now use Git to sync with the GitHub servers. Additionally, each time Windows is booted and logs in, our SSH key will be loaded, prompting for a passphrase if using one.