[英]How to run git command in full path?
As usually,we can use git status
.But under some reasons,the cmd can't recognize git
.So I need to use full path.Run where git
,I got this: 像往常一样,我们可以使用
git status
。但是由于某些原因,cmd无法识别git
。所以我需要使用完整路径。 where git
,我得到了:
C:\Program Files\Git\cmd\git.exe
How to use git full path? 如何使用git full path?
如果您只想运行git而在PATH中没有它,请使用:
"C:\Program Files\Git\cmd\git.exe" status
Like I stated in your other questions, you can handle everything like before. 就像我在其他问题中所说的那样,您可以像以前一样处理所有问题。
C:\Program Files\Git\cmd\git.exe status
Creates the same output as 创建与以下相同的输出
git status
Ofc when you run it in the cmd you have to use "
since the Path to the .exe
contains whitespace: 在cmd中运行Ofc时,您必须使用
"
因为.exe
的路径包含空格:
"C:\Program Files\Git\cmd\git.exe" status
Just replace git status
with C:\\Program Files\\Git\\cmd\\git.exe status
只需将
git status
替换为C:\\Program Files\\Git\\cmd\\git.exe status
Or in general replace git ...
with C:\\Program Files\\Git\\cmd\\git.exe ...
或者通常用
C:\\Program Files\\Git\\cmd\\git.exe ...
替换git ...
C:\\Program Files\\Git\\cmd\\git.exe ...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.