Getting Groovy (and Grails)

Explorations in Groovy and Grails Development

Getting Started with Git (Mac)

with one comment

This post provides simple instructions for getting git installed and set up on a recent (Leopard) Mac.

Start by going to the download page on the git website. Click on the “OSX installer” link, and then on the website, select the latest .dmg file (currently 1.6.3.1). Double click on the dmg file, and then double click on the git installer. You’ll need to enter your root password and when the installer says it was successful, you can eject and delete the dmg.

To test git, open a terminal and type “git”. You should see a list of commands. That’s it, you’re ready to get started with git. Go into a directory, “mkdir testproject”, “cd testproject” and “git init” and now you have an initial repo for that directory. Create a file (e.g. “touch myfile.txt”), “git add .” to add the file to the staging area, “git status” to check out the status, and “git commit -m ‘initial commit'” to commit the file to the repository. Now a “git status” will confirm that the working directory is clean and if you “gitk” you’ll get an (ugly) visual representation of the repo.

Looking for a prettier view of the repo? Download gitx – a nice repo viewer for git on the Mac. Download and install it, make sure to enable command line integration when installing, and then just type “gitx” within a git controlled directory and you’ll get a more attractive visual interface for repo viewing.

If you use TextMate, it has good support for core git commands. Just follow the download instructions here and remember to add the TM_GIT variable so TextMate can find git. Using the default installer, you’ll probably find that the git binaries are installed in /usr/local/git/bin.

You might also want to check out gitnub and changes, If you do, let me know how they work out for you as I haven’t had a chance/need to evaluate either to date.

Advertisements

Written by peterbell

June 5, 2009 at 12:46 pm

Posted in git

One Response

Subscribe to comments with RSS.

  1. You may want to check out this Finder toolbar button I made.

    After committing a local repo with gitX, pressing this button will push all committed files up to gitHub.

    http://github.com/WebVeteran/gitpush/


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: