Here's an online resource for Git that includes a downloadable e-book: http://git-scm.com/doc
All of Ratio's projects are stored on GitHub. Signing up for an account is free, and requires only your email address. Once you have an account you'll need to contact your practice lead to get added to the Ratio GitHub profile before you can start cloning and commiting to Ratio projects.
If you already have a GitHub account, use that! The profiles will be kept separate, and you'll only have to maintain one login. Sweet!
GitHub is a secure host, which means you'll need to be authenticated to use your account from your development machine. Configuring and registering your SSH keys with GitHub is outside the scope of this doc, but fortunately GitHub has a great reference for Windows, Mac and Linux users:
The easiest way to get up and running is to download one of the desktop clients. Not only will this give you a friendly GUI to get started with, it will also install the command-line tools you need to run Git in PowerShell or Terminal.
Git is a pretty intuitive version control system, but just like any other technology getting comfortable with it requires a bit of experimentation and research. These references will help to answer questions you might have after reading these docs.
Git is a distributed version control system, which means that every project clone is its own fully-qualified repository. Usually the repository on GitHub under the RatioInteractive account is the main repository, and should be kept pristine.
Any repository can be connected to any other repository as a remote. The repository you're working from is referred to as the local repository, and by convention the repository it was cloned from is called origin. Repositories can have any number of remotes, but to follow this doc you won't need more than origin.
While your editing a file, the changes you make will no longer be tracked by Git. Before you can make those changes permanent, you'll need to tell Git that you want to commit them by adding them to the stage.
Once all of your changes have been staged then you're ready to make them a permanent part of your file history by committing them.
Changes committed to your local repository will only appear in your local repository's file history. You'll need to push them to the origin repository before they are persisted on the server.
To keep your local repository in sync you'll have to pull changes down from the origin repository from time to time.
The log is a running history of commits. Every repository keeps its own log, and two repositories are considered "in sync" when their logs are equivalent.
Each entry in the commit log has it's own unique hash key. If you ever need to reference or roll back to a previous commit, you'll identify it by this key. Oftentimes you won't have to refer to the entire key; the first 7 or so characters are enough to identify the commit:
# These all refer to the same commit
$ git show 1c002dd4b536e7479fe34593e72e6c6c1819e53b
$ git show 1c002dd4b536e7479f
$ git show 1c002d$ cd /path/to/your/projects/dir
$ git clone https://github.com/RatioInteractive/CoolProjectBro.git
$ cd ./CoolProjectBro$ git pull origin master$ git add /an/entire/directory
$ git rm -r /an/unwanted/directory
$ git status$ git commit -m 'Fix all the things!'$ git log
$ get log --pretty=oneline$ git push origin master