Get up and running with GitHub

One of the consultants I worked a while back was praising the ease of Git Version Control System (VCS) and how it could be used in a disconnected mode. So I wanted to give it a try and started out with GitHub.

I have been using Visual Source Safe (VSS) Microsoft most of my life and have even written a workflow engine around it to push it from development to QA and then on for packaging. But I have dabbled with Apache Subversion (SVN) at times and now it has become the official standard in my company as well. At this point in time both VSS and SVN offer great integration with Visual Studio. Later on I would like to explore how Git integrates seamlessly with the VS IDE.

Git is definitely different to VSS and SVN in the way it manages versions and the ability to work disconnected. There's a great crash course at http://git-scm.com/book/en/Getting-Started-Git-Basics to understand this.
 

Setting up a GitHub Account

It was pretty easy to setup a Free GitHub account and create a repository (repo for short) to start off working. Just go to https://github.com and you would find all the instructions thrown at your face.
 

How to Setup Git on your Local Machine

Once you have got a repo created on GitHub the next step is to checkout the repo to your local drive to start working. Note that "Checkout" term here is totally different to the VSS "Checkout", in VSS terms this is equivalent to "Get Latest version".

Git is usually used via the command line. This "Set up Git" article on GitHub gets you going either via the command line app or the native windows app. I opted for the native windows app, but would definitely be exploring the command line app as I go along.

After installation, the Native Windows App was pretty easy to configure following the startup Wizard. Once I got to the initial screen, I changed the default storage directory to "F:\Github". 

The other feature which was lacking on the Free account was the ability to keep code private. But since I was working on some refresher stuff related to Umbraco which is open source, I had no issues with this. Do keep it in mind that your code is publicly accessible on a Free GitHub Account.

Syncing and Ignoring Files

The GitHub Windows Native App allows you to Sync your GitHub repo to a Local repo and vice versa at the click of a button. Once your files are synced, you might want to ignore certain files or folders as I did.


Sharing a code snippet a.k.a a "Gist" on your Blog

Another cool feature of GitHub is the ability to share source code or "Gists" as they are called on a blog article like given below. This feature is directly available on GitHub itself.

But I did not find a way to share a file on the GitHub repo directly. But http://gist-it.appspot.com support this and I've used this to share the configuration snippet given above.



 

To wrap up, I was able to successfully create a repo on GitHub, add the files (which was just a clean Umbraco install) locally on my desktop and then sync it with GitHub. My next task is to replicate the repo on my laptop. Will do that and keep you updated.

No comments:

Post a Comment