在 Android Studio 中从 Gitlab 克隆存储库时出现“存储库测试失败”错误?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24625335/
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
Getting "Repositroy test has failed" error while cloning repository from Gitlab in Android Studio?
提问by Karthik
I will like to clone my android code from gitlab repository in Android Studio 0.8.1.I checked into VCS >> Checked out from Version Control >> Git >> Added HTTP url here.It prompts me that "Repositroy test has failed".Kindly help me to sort out the issue.I have checked the plugins as well.Thanks a lot.
我想从 Android Studio 0.8.1 中的 gitlab 存储库克隆我的 android 代码。我签入 VCS >> 从版本控制检出 >> Git >> 在此处添加 HTTP url。它提示我“Repositroy 测试失败”。请帮我解决问题。我也检查了插件。非常感谢。
回答by Sree
You need to download and install git from http://git-scm.com/downloads
您需要从http://git-scm.com/downloads下载并安装 git
Then you need to track the git.exe on AndroidStudio:
然后你需要在AndroidStudio上跟踪git.exe:
Go to Settings> Project Settings> Version Control> VCSs> Git> Path to Git executable
Select (or type) executable path, eg:
D:\Program Files (x86)\Git\cmd\git.exe
前往Settings> Project Settings> Version Control> VCSs> Git>Path to Git executable
选择(或输入)可执行路径,例如:
D:\Program Files (x86)\Git\cmd\git.exe
If you installed GitHub Desktop for Windows
如果您安装了 Windows 版 GitHub Desktop
In case you have GitHub Desktop for Windows, git.exe
will be found at C:\Users\YOUR_USER_NAME\AppData\Local\GitHub\PortableGit_c7e0cbde92ba565zz218z5214zzz0e854zzza28\cmd
.
如果您有适用于 Windows 的 GitHub Desktop,git.exe
将在C:\Users\YOUR_USER_NAME\AppData\Local\GitHub\PortableGit_c7e0cbde92ba565zz218z5214zzz0e854zzza28\cmd
.
回答by Sebastian Holler
If you Installed git from http://git-scm.com/downloadsand also sett the correct path and still get an error maybe you sit behind a Proxy, in this case you have to add the Proxy to the git. This is Possible in the gitconfig. Wich should be avaiable in :\Program Files (x86)\Git\etc if you used the standard path for installation.
如果您从http://git-scm.com/downloads安装了 git并设置了正确的路径,但仍然出现错误,也许您坐在代理后面,在这种情况下,您必须将代理添加到 git。这在 gitconfig 中是可能的。如果您使用标准路径进行安装,Wich 应该在 :\Program Files (x86)\Git\etc 中可用。
回答by Christopher Kikoti
I am on Ubuntu 16.04 (this applies to other versions as well) and all I needed to do was to install git from apt-get:
我使用的是 Ubuntu 16.04(这也适用于其他版本),我需要做的就是从 apt-get 安装 git:
sudo apt-get install git
This means Android Studio was trying to execute git command but it could not be recognized so if you have git installed then try to execute git from terminal and if not recognized then you should configure paths to git executable. That was it!!!
这意味着 Android Studio 正在尝试执行 git 命令,但无法识别它,因此如果您安装了 git,则尝试从终端执行 git,如果无法识别,则应配置 git 可执行文件的路径。就是这样!!!
回答by Khalil Shakeri
I opened the HTTP URLin browser, that my collaborator sent me:
我在浏览器中打开了我的合作者发给我的HTTP URL:
for download and join the developing team, there was an accept button, after accepting hopefully the error gone, repository test was successful and I got the project in android studio. before this I had tried all the suggestion on this page and non of them was efficient.
对于下载并加入开发团队,有一个接受按钮,接受后希望错误消失,存储库测试成功,我在 android studio 中获得了该项目。在此之前,我已经尝试了此页面上的所有建议,但没有一个是有效的。
回答by Graph
Just to add to Sree's answer, I was getting this error even after installing Git, but the problem is that I didn't install it to the default installation folder.
只是为了补充 Sree 的答案,即使在安装 Git 后我也收到此错误,但问题是我没有将它安装到默认安装文件夹中。
After choosing the right path and folder in the VCS settings tab, it worked beautifully.
在 VCS 设置选项卡中选择正确的路径和文件夹后,它运行得很漂亮。
回答by Esmaeil MIRZAEE
I'm in Linux, At first check you have the appropriate certification to know this you can clone the repository in terminal if you get error similar this
我在 Linux 中,首先检查您是否拥有适当的认证以了解这一点,如果您收到类似这样的错误,您可以在终端中克隆存储库
fatal: unable to access 'https://YourDomainName/Project/GitRepository/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
then open your domain in browser and click on lock in the left of url go to detail and press export to save the certification and finally copy the content of the file and pase it into
然后在浏览器中打开你的域名,点击url左边的lock,进入详细信息,按export保存认证,最后复制文件内容粘贴进去
/etc/ssl/certs/ca-certificates.crt
For me this solution for the issue worked.
对我来说,这个问题的解决方案有效。
回答by Sumukh Bhandarkar
Goto Settings > Version Control > Git
and set SSH Executable
to "Native" instead of "Built-in". Then restart your IDE for settings to apply.
转到Settings > Version Control > Git
并设置SSH Executable
为“本机”而不是“内置”。然后重新启动 IDE 以应用设置。
Worked for me in all jetbrains IDEs.
在所有 jetbrains IDE 中为我工作。