Git and Textmate on OSX Lion

Have you seen this git bundle?

Just because it might save someone a bit of pain; if you are getting extremely tedious messages like the below when trying to use git in textmate after your upgrade (forced by an ill-timed and catastrophic hardware failure* or not), here are steps to fix. My googling found an awful lot of not very helpful stuff..

Evil error messages of doom:

sh: line 1: git: command not found

Administration >> Update Git bundle:

Updating git bundle

/Users//Library/Application Support/TextMate/Bundles/Git.tmbundle/Support/tmvc/../lib/git.rb:131:in `paths’: No selected files. (RuntimeError) from /Users//Library/Application Support/TextMate/Bundles/Git.tmbundle/Support/tmvc/../lib/git.rb:80:in `path’ from /Users//Library/Application Support/TextMate/Bundles/Git.tmbundle/Support/tmvc/../lib/git.rb:89:in `path_for’ from /Users//Library/Application Support/TextMate/Bundles/Git.tmbundle/Support/tmvc/../lib/git.rb:415:in `with_path’ from /tmp/temp_textmate.cRVD5L:22

 

FIX:

add the path to your git bin (get it by typing which git in a terminal window. remove the trailing git) in Preferences >> Advanced >> Shell Variables >> PATH like so:

/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin

add a new variable TM_GIT with a value of git

MAKE SURE THERE ARE NO TRAILING SPACES.

 

*Woe. Now. More installing. More. SO. MUCH. MORE.

Published by

tiff

Eclecticism is the light and the way. Parsnips are fantastic. Celeriac is evil.

2 thoughts on “Git and Textmate on OSX Lion”

  1. Thanks a bunch! This solved it for me and I am grateful.

    One more question; Are you getting an error if you click on the “Open diff in TextMate” link in the upper right hand corner of the git html window in TextMate?
    When I click on it, it indeed opens the diff in TextMate, but gives me the following error on the first line:

    “fatal: ambiguous argument ‘[“–check”]’: unknown revision or path not in the working tree.
    Use ‘–‘ to separate paths from revisions”

    Any idea where that’s coming from?

  2. Hey, glad it could help.

    Nope, I’m not getting that – maybe check your git version? I’m not on the latest – 1.7.6.1 ( git –version at command line), I can’t remember what comes with Lion as standard.

    Does blame (from the git menu in textmate) give the same error?

    Sounds a bit weird mind, maybe your repository is a bit borked, have you tried more than one?

Leave a Reply

Your email address will not be published. Required fields are marked *