Monday, April 5, 2010

Adventures when moving to GIT

I’ve been on Git hub a few times but never actually set this up on my laptop.  Following some Open Source work with a group of friends I finally got the point to the solution.  Distribution of the repositories and the ability to pick and choose the areas you want to take into your own, was such a simple and effective way to share code I decided to adopt it for most of my local development.

I am however not the best with the command line interface so when I heard that the tortoise group had got together and created an integrated windows version, I had to give it a go.

Setup

Download the software from Google code and run the MSI file worked first time without any issue.  You will however need to restart your PC/Laptop following the installation.

image

Following an reset you’ll get some extra options in your stadard windows explorer.

Connection to an existing repository

I already had an existing GitHub repository so it was a simple matter of connecting up to this.  First create a folder on your drive (in my case I called it Development) on your C Drive.  Right click on the empty directory and select Git Clone.

Select the URL on git hub of the git file and project you want to connect too, in this case the NXMPP code project.

image

Click Ok.

image

All going well you can click Close and have a copy of the code on your PC.

image

Pushing a change

So supposing you’ve a change to make to this code, how can you get it back to the cloud repository?  I’ve made a very simple change to one of the tests to illustrate the changes in one file.

image

Here in explorer you can see that Git has realised that there was a change to one of the files.

image

Right click the file and select “Diff” will bring up the a description of the changes.

Now lets say that change needs to be placed back into the repository, simply right click the file or directory and select Git Commit.  This will place the code back into the repository.

I’m looking forward to getting more into this very simple and interesting product.