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_LogoGitHub 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 and public collaborators. There are also plans that cater for private repositories and collaborators.

Git_Part2_GitHubSignup

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.

Git_Part2_GitHubKeys

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.

Git_Part2_KeyGen1

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.

Git_Part2_KeyGen2

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.

Git_Part2_KeyGen3

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 …

Git_Part2_KeyGen4

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.

Git_Part2_KeyGen5

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

Git_Part2_KeyGen6

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).

 Git_Part2_AddKey1

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.

Git_Part2_AddKey2

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

Git_Part2_AddKey3

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

 Git_Part2_AddKey1

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

Git_Part2_GitHubKeys

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

Git_Part2_AddKey4

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.

Git_Part2_AddKey5

GitHub is now set up with your SSH public key.

Next is forking the SolrNet project …

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s