Git on OS X Quickstart

I’ve actually been doing a little coding lately, thanks to an upcoming language shoot-out at Lambda Lounge in May.  I’ve almost got my first (only quasi-groovy) implementation complete and before I start on any refactoring, I figured it was a good time to get my version control on.

Since git is the new scm hotness, I figured I should give it a whack.  What follows is my extremely basic “just-get-me-going” instructions for OS X.

Step 1: Get git for OS X.  This is a binary release for OS X Leopard.  As of this writing, the latest version is

Step 2: Do your normal OS X install action on the downloaded binary.

Step 3 (Optional): Download GitX if you want an OS X native git GUI.

At this stage in the game you should be good to go.  Now it’s just a matter of creating your local git repo for your project. To do that, just cd to your project’s directory and type:

git init

Next, you’ll want to add everything in that directory into your local repo by typing:

git add .

Lastly, just commit it all…

git commit -m 'This is my first commit...blah, blah'

That should have you rockin’ for initial commits. The next thing I did (and which is completely optional) was to push my local repo up to my free (and therefore open source) account on github.

Once you create an account (and share your SSH public key) on github, you can then start creating projects. I created my “Vending Machine” project, then followed their directions to push up my local repo. I just entered the following commands:

git remote add origin
git push origin master

A nice cheat-sheet on basic git commands can be found here.

Leave a Comment

Name: (Required)

E-mail: (Required)