Will Harris
Will Harris

Reputation: 21695

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

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?

Upvotes: 27

Views: 12356

Answers (6)

spaghetticode
spaghetticode

Reputation: 343

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

Upvotes: 2

Blake Taylor
Blake Taylor

Reputation: 9341

Add the location of your git to the PATH shell variable in TextMate > Preferences... > Advanced > Shell Variables.

Upvotes: 0

conny
conny

Reputation: 10153

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. 

Upvotes: 3

Eric D. Fields
Eric D. Fields

Reputation: 152

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

Upvotes: 1

Peter Theill
Peter Theill

Reputation: 3220

@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).

Upvotes: 0

John Millikin
John Millikin

Reputation: 200916

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.

Upvotes: 49

Related Questions