Git, GitHub and an open source .NET project – Part 2

I have used the open source enterprise search platform Solr for a number of years now and on a recent project have been using the open source SolrNet .NET client library. The SolrNet library lacked a feature I required when used with the bundled Service Locator implementation. A number of people had been asking for the same feature so I decided to jump in and implement it.

This is part 2 of my journey into learning Git, using GitHub and contributing to an open source project.

What is GitHub ?

GitHub is the popular web-based hosting service for projects that use the Git revision control system. It has a large number of project management, code hosting and community based features.

Sign up for GitHub

GitHub offers a free account for open source projects. This account has an unlimited number of public repositories andpublic collaborators. There are also plans that cater for private repositories and collaborators.

The source code for the SolrNet project is hosted on GitHub so I signed up for the free plan and created myself an account on GitHub.

Once you have updated the Public Profile and Email Addresses sections of your account you will notice that you need to associate an SSH public key with your GitHub account.

Generate an SSH key

Fire up the PuTTY Key Generator executable puttygen.exe found in the PuTTY install folder.

Select the SSH-2 RSA radio button and ensure that the number of bits is set to 1024. Click the Generate button to generate the public/private key pair.

Cryptography calls for unpredictable random numbers. A simple way to obtain this randomness is to generate it from the user. The PuTTY Key Generator uses random mouse movements to generate randomness.

Give the generated key a comment and provide a passphrase. The passphrase provides an extra layer of security for your key. This is not my actual key but even if it was – all that is visible here is my public key which is meant for public distribution anyway …

Create a .ssh folder in your home folder. I created a C:\Users\paul\.ssh folder. Save your public key into this folder by clicking on the Save public key button.

Save the private key into your .ssh folder by clicking on the Save private key button.

You should now have a public/private SSH key pair for GitHub. My public key is github_rsa and my private key is github_rsa.ppk. Never let anyone have access to your private key !

Add public key to GitHub

Now we are ready to add our newly generated public SSH key to GitHub. Highlight the text in the Public key text box and copy it to the clipboard (CTRL-C).

If you have already closed the PuTTY Key Generator I’ll show you how to load the key back up. Fire up the PuTTY Key Generator executable again and click on the Load button.

Select your GitHub private key file and click on the Open button.

You’ll be required to provide your passphrase to load the private key.

Now highlight the text in the public key text box and copy it to the clipboard (CTRL-C).

Go back to the SSH Public Key section in your GitHub account. Click on the Add another public key link.

Paste (CTRL-V) the public key from your clipboard into the Key text box. Provide a Title for your key and click on the Add key button.