tags:

views:

1875

answers:

4

When trying to use some of the commands from the Git bundle for TextMate (eg. 'Show Uncommited Changes') I get an error message like 'sh: line 1: git: command not found'.

How do I make TextMate work with Git?

+18  A: 

http://theappleblog.com/2008/01/09/textmate-no-longer-a-reason-to-avoid-git/

Set the TM_GIT shell variable in the textmate preferences to your git executable to work to solve the command not found problem.

To find the path to your git binary, type "which git" on the command line. And of course, make sure Git is installed.

John Millikin
You beat be to the answer.
Will Harris
thanks a bunch, works.
Matthias
PS: for some reason, my colleague did not run into this problem on Snow Leopard, worked out of the box.
Matthias
This doesn't work for me in Snow Leopard. When I try to run "sh git" on the command line, I get this error:/usr/local/git/bin/git: /usr/local/git/bin/git: cannot execute binary file
Radamanthus
A: 

@Radamanthus You shouldn't run "sh git" from your commandline. You should run "git" directly. Also, you should use the which command (run "which git") to get a path to your git binary (as mentioned by @John Millikin).

Peter Theill
+1  A: 

Also, once you add the TM_GIT var, restart TextMate. Didn't work for me after the preference change without a restart.

Eric D. Fields
A: 

Thanks guys. Working perfectly for me now.

RealAT