git.exe 在 Windows 上突然消失了
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17876443/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
git.exe has been suddenly gone on Windows
提问by Telvin Nguyen
My machine has been using on Window 8 x64. I have installed Git on my Windows, everything has worked fine. I have configured the "Path to git executable" setting of my IDE (PhpStorm IDE) to the git exe which could be found on the following answer
我的机器一直在 Window 8 x64 上使用。我已经在我的 Windows 上安装了 Git,一切正常。我已将 IDE(PhpStorm IDE)的“git 可执行文件路径”设置配置为 git exe,可在以下答案中找到
Here is the location where git.exe has been located on my computer C:\Users[computer-name]\AppData\Local\GitHub\
这里是git.exe在我电脑上的位置 C:\Users[computer-name]\AppData\Local\GitHub\
But today, I got a message from my IDE: Can't start Git: git.cmd. Probably the path to Git executable is not valid. Fix it. (show balloon)
但是今天,我从我的 IDE 中收到一条消息:无法启动 Git:git.cmd。可能 Git 可执行文件的路径无效。修理它。(显示气球)
I have checked and the git.exe or git.cmd, they have been gone, I don't know why. I have tried to reuse the GitHubSetup which I've used for installing to repair or reinstall but the GitHub app was still opened normally because it seemed there never has problem with itself. The Github is working on my machine, I can see my repository, commit, etc. But I would like the git.exe to configure for my IDE.
我查过git.exe或者git.cmd,都不见了,不知道为什么。我试图重用我用于安装的 GitHubSetup 来修复或重新安装,但 GitHub 应用程序仍然正常打开,因为它本身似乎从来没有问题。Github 正在我的机器上运行,我可以看到我的存储库、提交等。但我希望 git.exe 为我的 IDE 进行配置。
How could I get back that missing file (git.exe)?
我怎么能找回丢失的文件(git.exe)?
回答by Max Leske
If Git is still available from the command line, then the binary is still around. Have you tried locating it with a search (with bash you could use $ which git
to tell you the location. Don't know an equivalent for the Windows command line though)? When you find it, you could try to copy it over to the location you need it for your IDE.
如果 Git 仍然可以从命令行使用,那么二进制文件仍然存在。您是否尝试过通过搜索来定位它(您可以使用 bash$ which git
来告诉您位置。虽然不知道 Windows 命令行的等效项)?找到后,您可以尝试将其复制到 IDE 所需的位置。
回答by Faisal Khan
Best solution and this will definitely work
最佳解决方案,这肯定会奏效
- Open you GitHub app and go in setting
- Go in About GitHub Desktop App
- Then click on open debug log
- Find git.exe in that txt file and then you will know current path that this using by GitHub Desktop app.
- 打开你的 GitHub 应用程序并进入设置
- 进入关于 GitHub 桌面应用程序
- 然后点击打开调试日志
- 在该 txt 文件中找到 git.exe,然后您将知道 GitHub 桌面应用程序使用的当前路径。
回答by Tim Cason
Since Git has several installation options I would like to point out that this solution is not for everyone.
由于 Git 有几个安装选项,我想指出这个解决方案并不适合所有人。
This solution is for the following case:
此解决方案适用于以下情况:
- OS : Windows 8 (not applicable for any other version)
- Git is installed as a Command Line Tool
- Git is installed at a default preset location
- 操作系统:Windows 8(不适用于任何其他版本)
- Git 作为命令行工具安装
- Git 安装在默认的预设位置
The git executable(sh.exe) for Command Line Tool is a script that in order to work will be based on the your windows Command Prompt (cmd.exe)
命令行工具的 git 可执行文件 (sh.exe) 是一个脚本,为了工作将基于您的 Windows 命令提示符 (cmd.exe)
You will need the following string to refer to Git correctly as an executable:
您将需要以下字符串才能将 Git 正确引用为可执行文件:
C:\Windows\SysWOW64\cmd.exe /c ""C:\Program Files (x86)\Git\bin\sh.exe" --login -i"
回答by user1506075
I had the same problem.
我有同样的问题。
I solved it by reinstalling git and pointed the "path to git executable" in PHPStorm to the git installed path.
我通过重新安装 git 解决了这个问题,并将 PHPStorm 中的“git 可执行文件路径”指向了 git 安装路径。
path for the git: YourInstalledFolder\Git\bin\git.exe
git 的路径:YourInstalledFolder\Git\bin\git.exe
I saw the the default PHPStorm git path is git.exe. It means that you could have a greater chance if you install git in the same directory where PHPStorm is installed.
我看到默认的 PHPStorm git 路径是 git.exe。这意味着如果您将 git 安装在安装 PHPStorm 的同一目录中,您可能会有更大的机会。