当我在 Windows 上的 Android Studio 中克隆 git 存储库时,存储库测试失败

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

Repository test is failed when I clone git repository in Android Studio on Windows

gitandroid-studio

提问by Singagirl

Since Eclipse is out of support I am migrating my Android projects under Android Studio. All my projects reside on Raspberry Pi and I was succeeded with cloning all projects on Linux machine. However I am getting the error under Windows 8.1.

由于 Eclipse 不受支持,我正在 Android Studio 下迁移我的 Android 项目。我所有的项目都驻留在 Raspberry Pi 上,我成功地在 Linux 机器上克隆了所有项目。但是我在 Windows 8.1 下收到错误。

enter image description hereEclipse didn't have any problem to work with the same URL and host is reachable using ssh client. What can be a problem?

在此处输入图片说明Eclipse 使用相同的 URL 没有任何问题,并且可以使用 ssh 客户端访问主机。有什么问题?

回答by kernix

For anyone who is looking for answer that anything else didn't help:

对于任何正在寻找其他任何方法都无济于事的答案的人:

My problem was due to 2 users in Github in the Keychain so I removed the password of the other user of my Github account and that solved the problem.

我的问题是由于 Keychain 中 Github 中有 2 个用户,所以我删除了我的 Github 帐户的另一个用户的密码并解决了问题。

Good luck

祝你好运

回答by Arsalan

You can use smart github from terminal.

您可以从终端使用智能 github。

Try it out on a public repository:

在公共存储库上尝试一下:

$ git clone http://github.com/schacon/grack.gitFor private repos, or to have push access on your repository, you can clone this way:

$ git clone http://github.com/schacon/grack.git对于私有存储库,或者要对存储库进行推送访问,您可以通过以下方式进行克隆:

$ git clone https://[email protected]/username/project.git

$ git clone https://[email protected]/username/project.git

回答by Fuhrmanator

This is a great example of an error message that is not much help.

这是一个没有多大帮助的错误消息的一个很好的例子。

Is git.exeavailable to Android Studio?

git.exe提供给Android的工作室?

In Settings > Version Control > Gitthere's a Testbutton to see if git runs properly.

Settings > Version Control > Git 中,有一个Test按钮可以查看 git 是否正常运行。

In my case, it wasn't visible (not installed). See http://guides.beanstalkapp.com/version-control/git-on-windows.htmlfor advice on how to install it.

就我而言,它不可见(未安装)。有关如何安装它的建议,请参阅http://guides.beanstalkapp.com/version-control/git-on-windows.html

回答by rfblue2

This is probably going to come out late, but I installed a new version of android studio and wanted to import from github and ran into the same problem.

这可能会迟到,但我安装了一个新版本的android studio并想从github导入并遇到了同样的问题。

My solution was, from the wizard that pops up when android studio is first run, go to Configure > Settings > Version Control > Github and then specify my github account. Then importing from git worked for me.

我的解决方案是,从首次运行 android studio 时弹出的向导中,转到配置 > 设置 > 版本控制 > Github,然后指定我的 github 帐户。然后从 git 导入对我有用。

回答by iman kazemayni

first check cloning from your git-bash ... run your git-bash(if you installed) and then go to a folder that you want reposite your project, for example:

首先检查从您的 git-bash 克隆...运行您的 git-bash(如果您已安装),然后转到您想要存储项目的文件夹,例如:

cd c:/myfolder

in your git bash (the directory must be created before). after that you can write a correct example url and clone statement:

在您的 git bash 中(必须先创建目录)。之后,您可以编写正确的示例 url 和 clone 语句:

git clone https://bitbucket.org/csgerber/reminders-git.git

git clone https://bitbucket.org/csgerber/reminders-git.git

this example url is correct and i test it. after a while in "myfolder" you must have the reminders project. if this method worked properly, you may not have any problem to do this in your android studio. however i coudn't because in my location, i coudn't connect to some server (for internet filtering) and i should use a proxy like freegate. so i need to set git for the proxy like this answer : Getting git to work with a proxy server

此示例网址是正确的,我对其进行了测试。在“我的文件夹”中一段时间​​后,您必须拥有提醒项目。如果此方法工作正常,则在 android studio 中执行此操作可能没有任何问题。但是我不能,因为在我的位置,我不能连接到某些服务器(用于互联网过滤),我应该使用像自由门这样的代理。所以我需要像这个答案一样为代理设置 git:让 git 与代理服务器一起工作

sorry for bad english

抱歉英语不好

回答by AhmedAbdelaal

I had this problem before and I solved it by unchecking the option "Clone git repositories using ssh" from Settings > Version Control > Git

我之前遇到过这个问题,我通过取消选中“使用 ssh 克隆 git 存储库”选项来解决它