21 Comments

Summary:

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 […]

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.

  1. Great article for Git beginners. The next time somebody will ask me about Git, I’ll point her or him to this site. Thanks Andrew.

    Share
  2. 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.

    Share
  3. 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.

    Share
    1. 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.

      Share
  4. 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.

    Share
  5. [...] and two basic graphical front ends) installed under Mac OS X. Our friends over at TheAppleBlog have a good post up on six of the best graphical tools for managing Git. Check it [...]

    Share
  6. [...] Using Git With OS X: 6 Tools to Get You Up and Running 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. (tags: osx git) [...]

    Share
  7. [...] previously covered a roundup of subversion and git tools. While the command line does work for these version tracking systems, a variety of [...]

    Share
  8. [...] I’m looking for a nice GIT GUI. Here is a [...]

    Share
  9. [...] Shared Using Git With OS X: 6 Tools to Get You Up and Running. [...]

    Share

Comments have been disabled for this post