Android Studio “Error Running Git” , 'Empty git --version output:'

巧了我就是萌 提交于 2019-12-05 14:23:54

问题


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?


回答1:


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

Subsequently, instead of choosing git-gui.exe option, I select just git.exe option. And it seems to work for me.




回答2:


default path of git.exe for GitHubDesktop 64-bit version is

c:\Users\AppData\Local\GitHubDesktop\app-<version>\resources\app\git\cmd\git.exe

you should try this path.




回答3:


in windows 10, 64bit version your installed git location is C:\Program Files\Git, There is a bin folder inside Git folder and there is a git.exe file, this is the file you have to choose or add in android studio.Works for me.




回答4:


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.

And add git installed path to environment variables (for windows OS):

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.




回答5:


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




回答6:


You should give a path in git.exe in cmd folder

Try this: C:\Program Files\Git\cmd\git.exe




回答7:


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.

c:\Users\<Your Windows username>\AppData\Local\GitHubDesktop\app-<version>\resources\app\git\cmd\git.exe



回答8:


For x64-bit Windows version change the path directory to

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




回答9:


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.



来源:https://stackoverflow.com/questions/42124682/android-studio-error-running-git-empty-git-version-output

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!