Android Studio "Error Running Git", 'Empty git --version output:'
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/42124682/
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
Android Studio "Error Running Git" , 'Empty git --version output:'
提问by DennisWPaulsenJR
I have looked at the other posts and have made certain that the path is correct to the executable file, as shown below. I can launch git from from this path outside of Android Studio. The current project is the "sunshine-version 2" from Udacity and it is a version or two old, but this should not affect the VCS from launching. I have read the other posts concerning this issue, but none have resolved this issue.
Also, when Android Studio gradle runs, it will open git in several windows and then close them almost immediately. They pop-up for a second or two, and then close. It's definitely trying to run git, and then default closes?
我查看了其他帖子并确定可执行文件的路径正确,如下所示。我可以从 Android Studio 之外的这条路径启动 git。当前项目是 Udacity 的“sunshine-version 2”,它是一两个旧版本,但这应该不会影响 VCS 的启动。我已阅读有关此问题的其他帖子,但没有人解决此问题。
此外,当 Android Studio gradle 运行时,它会在多个窗口中打开 git,然后几乎立即关闭它们。它们弹出一两秒钟,然后关闭。它肯定是在尝试运行 git,然后默认关闭?
回答by netoliguz
I just went to the Git path ubication, the only different thing that I did was have stopped at the cmd folder. As you might see in the next screenshot
我刚刚去了 Git 路径 ubication,我所做的唯一不同的事情就是停在了 cmd 文件夹。正如您在下一个屏幕截图中看到的那样
Subsequently, instead of choosing git-gui.exe option, I select just git.exe option. And it seems to work for me.
随后,我没有选择 git-gui.exe 选项,而是选择了 git.exe 选项。它似乎对我有用。
回答by AhuraMazda
default path of git.exe for GitHubDesktop 64-bit version is
GitHubDesktop 64 位版本的 git.exe 默认路径是
c:\Users\AppData\Local\GitHubDesktop\app-<version>\resources\app\git\cmd\git.exe
you should try this path.
你应该试试这条路。
回答by Ashana.Hymanol
in windows 10, 64bit version your installed git location is C:\Program Files\Git, There is a binfolder inside Gitfolder and there is a git.exefile, this is the file you have to choose or add in android studio.Works for me.
在 Windows 10 64 位版本中,您安装的 git 位置是C:\Program Files\Git,Git文件夹中有一个bin文件夹,还有一个git.exe文件,这是您必须在 android studio 中选择或添加的文件。对我来说有效。
回答by Marina Liu
The path you configure for git should be C:\Users\Computer\Documents\Development\Git\cmd\git.exe
instead. You should use git.exe
not git-base.exe
.
您为 git 配置的路径应该是C:\Users\Computer\Documents\Development\Git\cmd\git.exe
。你应该使用git.exe
not git-base.exe
。
And add git installed path to environment variables (for windows OS):
并将 git 安装路径添加到环境变量(对于 Windows 操作系统):
This PC -> properties -> Advanced system setting -> advanced Tab -> environment variables -> find path in system variables-> edit -> add the git installed path by ;C:\Users\Computer\Documents\Development\Git\cmd
-> ok.
这台电脑 -> 属性 -> 高级系统设置 -> 高级选项卡 -> 环境变量 -> 在系统变量中查找路径-> 编辑 -> 通过;C:\Users\Computer\Documents\Development\Git\cmd
-> 确定添加 git 安装路径。
回答by Mogician Ha
As mentioned by Marina-MSFT, you should add git.exe instead of git-base.exe or any other .exe files. You could find git.exe under, in your case, C:\Users\Computer\Documents\Development\Git\bin\git.exe, normally the git.exe file is under bin file of Git you have installed
正如 Marina-MSFT 所提到的,您应该添加 git.exe 而不是 git-base.exe 或任何其他 .exe 文件。您可以在 C:\Users\Computer\Documents\Development\Git\bin\git.exe 下找到 git.exe,通常 git.exe 文件在您安装的 Git 的 bin 文件下
回答by RAKESH CHAUDHARI
You should give a path in git.exe in cmd folder
你应该在 cmd 文件夹中的 git.exe 中给出一个路径
Try this: C:\Program Files\Git\cmd\git.exe
试试这个:C:\Program Files\Git\cmd\git.exe
回答by Ekeuwei
For x64-bit Windows version change the path directory to
对于 x64 位 Windows 版本,将路径目录更改为
Android Studio: File > Settings... > Version Control > Git
c:\Users\AppData\Local\GitHubDesktop\app-<version>\resources\app\git\cmd\git.exe
Change default settings on Android Studio
更改 Android Studio 上的默认设置
回答by Ali Aryan
you should go into the "cmd" folder which is created in the main folder that you've installed the Git program. (usually is C:\Program Files\Git). In this folder you can find Git.exe then copy this address in configuration windows in Android Studio.
您应该进入在您安装 Git 程序的主文件夹中创建的“cmd”文件夹。(通常是 C:\Program Files\Git)。在此文件夹中,您可以找到 Git.exe,然后在 Android Studio 的配置窗口中复制此地址。
回答by KARAN SHAH
This is the path where GitHub is located in its default installation. Remove the text including "<>" characters in below path and enter your relevant values.
这是 GitHub 在其默认安装中所在的路径。删除以下路径中包含“<>”字符的文本并输入您的相关值。
c:\Users\<Your Windows username>\AppData\Local\GitHubDesktop\app-<version>\resources\app\git\cmd\git.exe