The easiest way to get up and running with Git on windows is to download and install Git for Windows. You can find the latest build available for download here: Git for Windows.
For this article, I'm going to use
Once you've downloaded that, run it, agree with the security questions, and install it with all the default options selected. You should have a shortcut to Git Bash on your desktop now.
The easiest way to set Git up is to use the Git GUI. Find that in your start menu and run it.
Now go to
Help, and then
Show SSH Key. You should get this window:
Generate Key and enter a passphrase. Make sure you remember this, you'll use it every time you push/pull changes to/from GitHub. It's important.
Now go to your GitHub account. If you don't have one, make one - you'll need it. Once you're logged in, go to your
Next, click the
SSH Keys tab.
Once you've done that, click
Add SSH Key and paste in the big chunk of text that you generated before in Git GUI. Give it a memorable name, such as HomePC or WorkPC, and click
You can close
Git GUI now.
We're now going to configure our Git profile. Open up
Git Bash and enter the following, being sure to enter your own details:
git config --global user.name "Firstname Lastname" git config --global user.email "firstname.lastname@example.org"
That's that done.
Now let's clone a repo to test it. I find it best to have a single directory for all my GitHub repositories. Feel free to put them where you like, but for this we'll be using
Git Bash uses Linux style file paths, so we have to keep that in mind when using it. Change directory to C using the
And now let's create a directory called GitHub using the
Now let's move into that directory, again using the
Excellent. Now let's clone a repository. I'll provide one of my smaller repos, but feel free to use any you like. In Git Bash, clone the repo like so:
git clone git://github.com/Imdsm/Slugify.git
Git Bash will now create a directory for the repo and download all the latest files for you. If you open up that directory in Windows Explorer, you'll see everything is working perfectly:
And there you have it. Git for Windows.