TextMate: No longer a reason to avoid Git
I wrote recently about my headaches using Subversion with iWork documents (“iWork hates Subversion”). The consensus from the comments was that I needed to ditch Subversion for a more modern version control system. Both Mercurial and Git were popular among commenters. (I decided on Git, incidentally. The transition was extremely smooth.)

One TAB reader, HG, lamented that a TextMate bundle doesn’t yet exist for Git. Consider that old news. Well, unofficially. It is currently under review within the TextMate user community, but the Git bundle has been written and is available to any TextMate user who syncs to the TextMate SVN repository.
Copy (or link) the bundle from Review/Bundles into Bundles and relaunch TextMate or Reload Bundles (under the Bundles menu), and voilà!, your copy of TextMate now supports many of Git’s version control features — in addition to every other open-source version management system on the planet.
Instructions for syncing from the TextMate SVN repository is available at the TextMate wiki.


#1 Tom Morris says:I tried it, but it doesn’t seem to work for me. I get messages like:
“sh: line 1: git: command not found /tmp/temp_textmate.HDp2oQ:5: command not found: git ls-files -o –exclude-per-directory=.gitignore /tmp/temp_textmate.HDp2oQ:5: command not found: git ls-files -m –exclude-per-directory=.gitignore Cancel”
(when committing)
“/tmp/temp_textmate.nRqCW9:4: command not found: git log IndexPage.txt”
(when showing log)
“sh: line 1: git: command not found sh: line 1: git: command not found /tmp/temp_textmate.0PsLEE:4: command not found: git branch”
(when getting branch list)

#2 Travis Jeffery says:Tom are you sure that you have Git installed? If you have MacPorts installed run: sudo port install git-core

#3 Tom Morris says:Ah, I installed Git manually rather than using port.

#4 Tom Morris says:Reinstalled from port, checked out bundle from SVN again - still no joy - same errors as before.

#5 Travis Jeffery says:What does your path say? (run $PATH in command line)

#6 Tom Morris says:/sw/bin:/sw/sbin:/usr/local/bin:/usr/local/sbin:/Users/tom/bin:/sw/lib/python2.5/site-packages/django/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/X11R6/bin
(Thanks for the help thus far, Travis)

#7 Travis Jeffery says:Geez. I think that it’s a problem with the Git version, and that TextMate isn’t finding the Port version. Try uninstalling the Git version that you installed from source. And then if that doesn’t work try asking some people on IRC, ##textmate on irc.freenode.net would be a good place, and if they can’t think of anything just use SVN ;p.

#8 Marco Lopes says:I had the same problem as you and I noticed that whereis was returning nothing for git, I created a link in /usr/bin pointing to my original git in /usr/local/bin, the whereis started returning the path /usr/bin/git and the bundle started working

#9 Peter Earle says:Set the TM_GIT shell variable in the textmate preferences to your git executable to work to solve the command not found problem.

#10 Tim Harper says:Allan Odgaard has stopped development of the git textmate bundle and has graciously handed the baton over to me.
The git textmate bundle can now be found at:
http://gitorious.org/projects/git-tmbundle/
More info: http://blog.macromates.com/2008/git-bundle/