msysgit bash shell-如何排查故障“无法找到命令” [英] msysgit bash shell- how to troubleshoot "cannot find command"
问题描述
我需要帮助让git扩展与msysgit一起运行。我使用扩展名git-tfs和git-fetchall遇到了不好的结果,在这两种情况下它都是同样的问题。插件需要将文件放在git可以找到的地方(git-tfs.exe和git-fetchall.sh)。我理解这意味着这些文件需要位于PATH环境变量中的目录中。
在这两种情况下,我都陷入了困境:
$ git-diffall
bash:git- diffall:找不到命令
或:
$ git-tfs
bash:git-tfs:找不到命令
当我从常规命令shell运行echo%PATH%时,它显示我的路径变量包含git-diffall和git-tfs所在的目录。我该如何调试,或者我错过了什么? msysgit中有没有一种方法来验证命令搜索路径是我所期望的?
好的,我找到了断开连接。直到我开始从shell运行echo $ PATH(而不是从Windows命令shell返回具有不同结果的%PATH%)时,它是难以捉摸的。
两个问题:
-
当我配置环境变量时,我最初在路径末尾有一个'\'。这似乎导致echo $ PATH显示无效路径名称,如'/ c:/ directory'而不是'/ c / directory /.
-
需要重启通过windows UI制作的系统环境变量的更改将反映在msysgit / bash / git shell中。
I need help getting git extensions to run with msysgit. I have had bad luck with extensions git-tfs and git-fetchall, in both cases it is the same problem. The addon will require a file to be placed where git can find it (git-tfs.exe and git-fetchall.sh). I understand this to mean the files need to be in a directory that is in the 'PATH' environment variable. In both cases I get stuck at this point:
$ git-diffall
bash: git-diffall: command not found
or:
$ git-tfs
bash: git-tfs: command not found
When I run echo %PATH% from a regular command shell, it shows my path variable includes the directories where git-diffall and git-tfs are. How can I debug this, or am I missing something? Is there a way within msysgit to verify the command search path is what I expect?
Ok, I found the disconnect. It was elusive until I started running "echo $PATH" from the shell (rather then echo %PATH% from the windows command shell, which had a different result).
Two problems:
When I configured the environment variables, I originally had a '\' at the end of the path. This seemed to caused echo $PATH to show invalid pathnames like '/c:/directory' instead of '/c/directory/.
A reboot was necessary for changes to the system environment variables made through the windows UI to be reflected in the msysgit/bash/git shell.
这篇关于msysgit bash shell-如何排查故障“无法找到命令”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!