代码之家  ›  专栏  ›  技术社区  ›  Will Harris

textmate git命令失败,错误为'sh:line 1:git:command not found'

  •  27
  • Will Harris  · 技术社区  · 15 年前

    尝试使用git包中的某些命令执行textmate(例如“显示未斜接的更改”)时,会收到一条错误消息,如“sh:line 1:git:command not found”。

    我如何使textmate与git一起工作?

    6 回复  |  直到 13 年前
        1
  •  49
  •   John Millikin    15 年前

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

    在 将首选项与Git匹配 可执行工作来解决 命令未找到问题。

    要找到git二进制文件的路径,请在命令行上键入“which git”。当然,要确保安装了Git。

        2
  •  3
  •   conny scipilot    14 年前

    如果你已经允许 git-osx-installer 使Git可用于非CLI应用程序(即,它在 /等/路径.d/git )然后你就可以……

    Untick the PATH shell variable set by default in the textmate preferences. 
    
        3
  •  2
  •   Kevin    13 年前

    我最近和雪豹遇到了同样的问题,上面的任何一个解决方案似乎都不起作用。所以我在 /usr/bin 我的Git可执行文件如下:

    cd /usr/bin
    
    sudo ln -s `which git` git
    

    然后重启 Textmate 它就像一种魅力,没有任何变化

        4
  •  1
  •   Eric D. Fields    14 年前

    另外,一旦添加tm_git var,重新启动textmate。在没有重新启动的情况下,首选项更改后没有为我工作。

        5
  •  0
  •   Peter Theill    14 年前

    @Radamanso你不应该从你的命令行运行“sh git”。你应该直接运行“git”。另外,您应该使用哪个命令(运行“which git”)来获取git二进制文件的路径(如@john millikin所提到的)。

        6
  •  0
  •   Blake Taylor    14 年前

    将git的位置添加到中的path shell变量 TextMate > Preferences... > Advanced > Shell Variables .