Using Git With OS X: 6 Tools to Get You Up and Running

21 Comments

Who are you calling a Git? When I say ‘Git’, I don’t mean the British derogatory term that was immortalized by the TV show Red Dwarf. I mean of course the latest generation of revision control systems, designed by Linus Torvalds for use on the Linux kernel. You can read up on the history of Git at its Wikipedia entry — but what you really need to know is that it is quickly becoming as popular as SVN and CVS and is being used for many open source projects. Thus if you have a need to obtain source from git, or contribute to a project being stored in a git repository, then you will need to install git.

There are a few ways to get the base Git package (with the Git command-line client and two basic graphical frontends) installed under OS X, including compiling the source-code yourself, or installing it via MacPorts. However the easiest is by simply downloading and running the Git os x installer, which will do everything for you.

Once Git is installed, you can quickly create a local Git ‘clone’ of a source repository such as VLC’s, by opening a terminal window, navigating to the directory you’d like the source to exist and then typing git clone git://git.videolan.org/vlc.git. Once you have your local clone, you can make your changes and stage commits back with the command-line client. To find out all the power and functionality of Git, you can read the tutorials and detailed documentation that’s available at Git’s official webpage.

As Git is quite new, there are not many UI front-ends available yet, and even less specifically for OS X — with none of them being very mature. However, I’ve compiled a list of six tools/apps for managing Git on OS X. The two native OS X apps (GitX and GitNub) should be watched carefully over the next year or so, as they could turn into some excellent software.

Gitk

gitk
GitK comes with the command-line git client and is a tcl/tk application that lets you browse the history of repositories. This can be launched by typing gitk in a terminal. It’s not pretty, but it does the job and serves as a reference for future clients.

Git Gui

git-gui
Git Gui also comes with the command-line client and is likewise also a tcl/tk application. This lets you perform staged commits on your code and can be launched by typing git gui in a terminal. Note the space between the two words, tab-completion on the terminal will not find this, but it is there. While the UI is more appealing than GitK, it leaves a lot to be desired when one is used to the Aqua and Cocoa UI.

GitX

gitx
GitX is an attempt to bring OS X’s shiny interface in all its glory to the functionality of gitk and git gui. It currently allows viewing revision history and committing files. You will need to make your local clone manually with the command-line client first, then you can open the cloned directory and use the UI to browse and commit.

GitNub

gitnub
GitNub is another OS X specific client being written in CocoaRuby. Its not yet officially released and the only way to get it running is by compiling it yourself by cloning the git directory and building it in XCode. Once built and pointed at a local git repository, it allows browsing the various history. Where this goes in the future could be interesting.

OpenInGitGui

openingitgui
OpenInGitGui is an AppleScript extension to Finder that simply enables you to quickly and easily open the current clone in Git Gui without having to manually launch it from a terminal. After installing the compiled AppleScript, you then just drag it onto Finder’s toolbar to create a new tool button. Once you navigate to a local Git clone, you can just click the button to make Git Gui launch.

Eclipse Plugin

eclipsegit
There is a Git plugin for the cross platform IDE Eclipse that works under OS X. This is impressively functional with the ability to clone a Git repository and import it directly as an Eclipse project. It then lets you browse history, perform comparisons and diffs and do commits. If you use Eclipse, this is an ideal solution.

The Future

Git is still very new, and as it grows in popularity, the number of clients supporting it will also grow. Stay tuned to TheAppleBlog for news and updates on using Git with our favorite desktop environment.

21 Comments

Ian Beck

Another recent entry to the field of Git GUI’s (and my personal favorite so far) is Gitbox:

http://gitboxapp.com

Found this thread searching for alternatives, and wanted to mention it. The main upside and downside to Gitbox is that it’s REALLY simple. Very nice, easy to use UI as a result, but you can’t do much beyond branching, merging, pushing and pulling, and managing staged changes.

FredB

There is also:
– Tower (http://www.git-tower.com/) free during beta, pricing will be announced later.
– SourceTree (http://www.sourcetreeapp.com/), £35 works with Mercurial too, free trial.

Being able to work with hg and git in SourceTree is nice but Tower’s UI is better IMO. They both looks like real Mac OS X applications at least, which is not the case of most tools mentioned here…

Rodion

Great article, thanks.
Btw, there is one more app, which hasn’t mentioned here — GitBox. I think it deserves mentioning, since it’s free for one repository (which is great!) and has nice interface.

Thomas Wichern

Thanks for the helpful atticle,

I’d like to recommend two other tools as well:
– SmartGit, a cross-platform GUI that shows the tree etc.
similar to Visual Source Safe and might help VSS users to
get familiar with git.
(free for non-commercial users) -> http://www.syntevo.com
– vss2git, a converter that converts Visual Source Safe
repositories (incl. history!) to one or more git repos.
Open Source -> http://code.google.com/p/vss2git/

Both tools can help VSS users to get rid of it… and to migrate to git.

Dad

Thank you. An updated on this review of the current options would be of interest.

Melladh

The Red Dwarf term was “goit”, not “git”.
Thanks for the interesting list though! :) (and yes, I realize I’ll have to look around a bit more to see how much of this is outdated by now)

Jon Maddox

While not a native desktop tool, GitHub should also be mentioned. GitHub (http://www.github.com) facilitates the sharing of code like it’s never been done before. Want to contribute to a project? Fork it on GitHub, clone your repo, make the changes, push them back up and send the maintainer a fork request.

Git and GitHub makes distributive collaboration a no brainer.

Matt Radel

Nice write-up! Git sounds interesting…but I’m wondering if there’s any way we could get a soup to nuts tutorial on setting up SVN or CVS on a local network? I’ve been trying to set one up for my office (with a mac mini acting as a file server) and I’ve been pulling my hair out. I’ve tried reading through the online book for SVN but it’s very little help.

Michael Langford

I’d suggest just diving into git if you’re not on SVN already. Feels weird for like a week, then its 100x easier to maintain and setup than svn, and requires less “good behavior” from everyone in the office.

Rafael Bugajewski

Another thing I wanted to mention: I think it’s hard to get the whole power of Git into a GUI, but GUIs are usually a nice start.

There is also the possibility to run git instaweb –httpd webrick in the terminal on Mac OS X and you’ll get a nice web site with the repository’s summary.

Comments are closed.