简体   繁体   English

如何在完整路径下运行git命令?

[英]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.

相关问题 如何从 Windows forfiles 命令运行带有完整路径的命令? - How do you run a command with a full path from the Windows forfiles command? 如何更改“运行命令”“记事本”的路径? - How to change the path for “run command” “notepad”? 如何在不指定完整路径的情况下可移植地运行 Python 脚本 - How to run a Python script portably without specifying its full path 如何在不指定完整路径的情况下运行 python 脚本 - How to run python scripts without specifying their full path 在Windows上的Scala代码中运行shell命令似乎需要命令的完整绝对路径 - Run shell commands in Scala code on Windows seems to require the full absolute path of the command git-bash.exe:如何运行单个命令? - git-bash.exe: how to run single command? 如何从 Windows 命令在 Git Bash 中运行某些东西 - How to run something in Git Bash from Windows command 如何配置git difftool / mergetool传递文件的完整路径? - How can I configure git difftool/mergetool to pass full path of files? 如何在命令行中获取父目录/当前目录的上层目录的完整路径 - How to get the full path of the parent directory / upper directory of the the current directory in command line 如何使用dos命令在没有完整路径的情况下找到文件夹的目标? - How to find the a destination of folder without having its full path using dos command?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM