This post is to serve as quick and painless instructions to get the less technically-inclined up and running with working version control as fast and painlessly as possible. 🙂
First and foremost, download and install Git: http://git-scm.com/downloads. Default options should be fine for everything.
There are a number of Git clients out there, but the one I am currently using is TortoiseGit. Its easy to use and integrates well with Windows. Download and install with default options: http://code.google.com/p/tortoisegit/. TortoiseGit adds a menu to your right-click context menu whenever you right click on a file or folder. This a very easy way to interact with your repositories.
So now we have everything we need to start working with Git, however, many of the benefits of version control come from hosting your repository on a server. This acts as a live access point for you and your team, as well as a measure of security by having your important files redundantly saved online. Bitbucket.org is a fantastic free service that allows you to host free public and private repositories. Sign up for BitBucket and create a private repository.
Bitbucket uses SSH encryption to protect your private repository and grant you and only you remote access to your files. You need to generate a public and private ssh key pair. TortoiseGit comes with a tool called PuttyGen. Open it and click the “Generate” button. It will ask you to move your mouse around a bunch to help create “randomness”. Save BOTH the public and private keys to a safe location on your computer. Usually a folder named “.ssh” in your home directory is used. The private key is your identity. Never give it to anyone. It is yours and it is as unique as you are. The public key is given to anyone you want to be able to verify your identity. For us, this is BitBucket. Go to the SSH Keys section in your BitBucket account settings. Here is where we upload our public key.
Now, go to your repository on the BitBucket web site and click the “Clone” button. Copy the URL. It should look something like this: “git clone firstname.lastname@example.org:<your_user_name>/<your_repo_name>.git”
In Windows explorer, right click, you should see the TortoiseGit menu options. Select “Git Clone…”. All you need to do is paste your repository URL, tell it where to save your local copy of the repository on your computer, and supply your private key file that we generated earlier using PuttyGen.
Thats it! You now have a working Git repository! The basic way to interact with your repository is to add and edit files like you normally would. When you are happy with your changes, right click on your repository, and select “Git Commit…”. A window will pop up showing you all of your changes. Make sure you check any new files you added. Write a comment describing the changes you made in detail then click commit. This commits the changes to your LOCAL repository, you probably want to upload them to your BitBucket repo so your team mates can check out your awesome changes. Just press the “Push…” button on the next window. Now we have pushed all of our changes to the Bitbucket repo!
These are the basics of getting set up and how you will work with Git the majority of the time. There is, of course, a lot more to working with Git, TortoiseGit, and BitBucket than explained here, but with a little googling you should be just fine.
You can learn more about Bitbucket features and SSH here if you are so inclined: https://confluence.atlassian.com/display/BITBUCKET/Bitbucket+101
Have fun with Git! 🙂