Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Textmate git commands fail with 'sh: line 1: git: command not found'

Tags:

git

textmate

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?

like image 344
Will Harris Avatar asked Aug 12 '09 22:08

Will Harris


4 Answers

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.

like image 146
John Millikin Avatar answered Nov 16 '22 13:11

John Millikin


If you already allowed git-osx-installer to make git available to non-CLI applications (i.e. it planted a file in /etc/paths.d/git) then you could just..:

Untick the PATH shell variable set by default in the textmate preferences. 
like image 3
conny Avatar answered Nov 16 '22 12:11

conny


I recently run in the same problem with Snow Leopard, and none of the above solutions was apperaring to be working. So I made a symlink in /usr/bin to my git executable file like this:

cd /usr/bin

sudo ln -s `which git` git

then relaunched Textmate and it worked like a charm, without adding any variable or whatever

like image 2
spaghetticode Avatar answered Nov 16 '22 13:11

spaghetticode


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

like image 1
Eric D. Fields Avatar answered Nov 16 '22 14:11

Eric D. Fields