For a while I was using git and github for uploading my code and projects. ( In case you yet not familiar with it – github is really a great place for storing your code and collaborating/ sharing your work with others, so please check it out.)
I was using Ubuntu OS and ofcourse – on Linux machine git is basically installed with a single command and SSH keys are created very easy.
Windows users had the option for using stuff like cygwin, to be able to get the git functionality under windows, which at some point could be a little anoying for the GUI type of guys
…Well not anymore!
After switching back to windows I was amazed how much TortoiseGit has improved for the last few years, and how easy it is now for the windows users to use git
In this tutorial I’ll cover the following:
- how to install everything you need to setup Git and TortoiseGIT on your lovely Windows OS.
- how to generate a private key with PuttyGen and set this up on your github account
- how to initially create your repo at github and clone the repo to your local machine
OK – lets do this !
Step 1. Install msysgit
First thing you need to do is to get a distribution of git for windows. I this tutorial I use msysgit.
You can also try cygwin – which is very popular linux shell emulation for windows, but I haven’t yet tested it so I cannot currently recommend using it.
You can download msysgit at: http://code.google.com/p/msysgit/downloads/lis
The file that you need should look for is: msysGit-fullinstall-XXX-preview-some-date – where XXX is the version. Download the latest version and install it. The unpackaging and building process might take a several minutes depending on your CPU speed – so don’t worry about this.
Step 2. Install TortoiseGit
Ok after we are ready with this please proceed and install tortoisegit:
Get it at:
http://code.google.com/p/tortoisegit/downloads/list
Download and install the latest version and proceed.
You will be asked to choose between Plink and OpenSSH. Choose Plink, so that you could ease the process of generating SSH keys. Ok after the install is finished you can reboot your machine (probably won’t be required but just in case).
Step 3.Basic config of TortoiseGit
Now the TortoiseGit Context should appear:
Please check if MSysGit Git.exe path is pointing to the installation of your installation of msysgit (Step 1.)
Also check if TortoisePLink is correctly setup – this should be entered by default – but it’s good to know where this is entered, so that you could have a basic idea of the authentication part.
Make sure to go into Git -> Config section, and to add your name and email address – if you are using Github – make sure to add the same credentials that you are using for Github as well.
Ok now it’s time to generate some private keys. Please go to Start-> All Programs -> TortoiseGit -> PuttyGen. The executable is usually located at C:\Program Files\TortoiseGit\bin\puttygen.exe if you installed TortoiseGit into default directory.
Just use all the default settings – as in the screenshot above (SSH-2 RSA 1024bit) and generate a private key. Then save it somewhere on your harddrive – where you wont forget it or delete it. The password is optional. Also copy the text at the key section (as shown in the screenshot – mark it and copy it – because you’ll need this for the next step)
Step 4. Setting up the GitHub account to use private key
Go to your account at https://github.com/ and then go to Account settings -> SSH Public Keys or go directly to https://github.com/account/ssh
Add a description title for this key and paste it’s value from the previous step.
Ok now you can create a new repository or use one of your existing ones (if you have any).
Go to https://github.com/repositories/new and create a new repo. Name it for example ‘test’. Now go to https://github.com/account/repositories and then click on the test repo. The new address of your repository should be:
<strong>git@github.com:yourGitHubUserName/test.git</strong> So let's test how it works now. We'll try to 'download' the test repo we created using the git clone command. For those of you who've used SVN - this is similiar to the SVN checkout command. Create some empty folder on your harddrive and hit Rightclick -> Git Clone: <a href="http://georgi-mitev.com/wp-content/uploads/git-clone.png"><img class="alignnone size-full wp-image-325" title="git-clone" src="http://georgi-mitev.com/wp-content/uploads/git-clone.png" alt="" width="487" height="363" /></a>
Make sure that the path to test repo is correct, also add the path to your ppk file (the file we created in Step3.)
You should get success message like this:
Great !! You’ve cloned your first repo
If you are not familiar with git at all I suggest you start with learning the follwing commands
branch, add, commit, push, pull - these are the most basic git commands that can get you started.
Please check also these great sources on working with git:
http://scottchacon.com//2011/08/31/github-flow.html
if you need to migrate your current SVN repo to git -> check the link below
http://www.jonmaddox.com/2008/03/05/cleanly-migrate-your-subversion-repository-to-a-git-repository/
If you have any additional questions or requests please contact me or add your question in the comment section below.
I’ll write additional tutorial on adding correctly written gitignore file.
Thank you fellas – see you next time








recent comments