android studio 的 git.exe 错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/43573340/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 12:43:27  来源:igfitidea点击:

git.exe error for android studio

androidgitandroid-studio

提问by UDIT PATEL

Recently I am trying to connect git hub repository to android studio but it shows following the error:

最近我试图将 git hub 存储库连接到 android studio,但它显示以下错误:

Error Image

错误图片

采纳答案by ajay.kumar

get a git path from your pc

从你的电脑获取一个 git 路径

go to my computer >open c:drive > Users>YourUser>Appdata>Local>Github>PortableGit_\cmd\git.exe

转到我的电脑>打开 c:drive > 用户>你的用户>Appdata>Local>Github>PortableGit_\cmd\git.exe

then copy the file location and past it into your git executable path in android studio as shown in the above image

然后复制文件位置并将其粘贴到 android studio 中的 git 可执行路径中,如上图所示

回答by Mukesh M

Git Android Studio

Git Android 工作室

Go to Settings-->Version Control-->Git and Fix Path to Git executable. Also click test button to check it is working.

转到设置--> 版本控制--> Git 和修复 Git 可执行文件的路径。同时单击测试按钮以检查它是否正常工作。

回答by Samson Muwanguzi

For my case git.exe was in the Path C:\Users\Username\ AppData\Local\GitHubDesktop\app-<appversion>\resources\app\git\cmd\git.exe

对于我的情况 git.exe 位于路径 C:\Users\Username\AppData\Local\GitHubDesktop\app-<appversion>\resources\app\git\cmd\git.exe

回答by Tamim Attafi

I know this might sound stupid but yes, it is as stupid as it is!

我知道这听起来可能很愚蠢,但是是的,它确实很愚蠢!

I had this same error on Linux and was searching for a solution for two days! Then one day was trying to solve this, by chance, I cleared the path specified in android studio and Voilà! Android studio auto detected my git(facepalm)! And the interesting thing is it was not the path I was pointing to (bin/usr/git), and not the path returned by which gitcommand (same path), it was /app/bin/git

我在 Linux 上遇到了同样的错误,并在两天内寻找解决方案!然后有一天试图解决这个问题,偶然地,我清除了android studio和Voilà中指定的路径!Android studio 自动检测到我的git(脸掌)!有趣的是,它不是我指向的路径 ( bin/usr/git),也不是which git命令返回的路径(相同路径),而是/app/bin/git

For intellij idea and other products of JetBrains is quite the same issue, but the path detected by the two is different! Intellij idea was pointiong to /usr/bin/git!

对于intellij idea 和JetBrains 的其他产品是完全一样的问题,只是两者检测到的路径不同!Intellij 的想法指向了/usr/bin/git

For people still having this error even if their gitis installed and android studio is pointing to its path, go to Settings-> Version Control-> Gitand delete everything inside the text box with the label Path to Git executable, your android studio or what ever JetBrains product you're using, will auto-detect it.

对于即使git已安装并且 android studio 指向其路径的人仍然遇到此错误,请转到Settings-> Version Control->Git并删除带有标签的文本框中的所有内容Path to Git executable、您的 android studio 或您正在使用的任何 JetBrains 产品,会自动检测。