windows下Idea使用git clone failed. Could not read from remote repository.

来自:互联网
时间:2020-09-16
阅读:

刚入职新公司,等了好几天,今天公司给发了新电脑,就要开始进行开发环境的安装了。

在软件(JDK,GIT,IDEA,MySQL,Navicate。。。等等)都安装完成后,就开始项目的下载。

下载项目:

<a href=https://www.freexyz.cn/tag/Windows.html target=_blank class=infotextkey>Windows</a>下Idea使用git clone f<a href=https://www.freexyz.cn/tag/AI.html target=_blank class=infotextkey>AI</a>led. Could not read from remote repository.

在使用IDEA下载的过程中就发现了新的问题---根据gitlab中项目的地址进行下载时提示“clone failed. Could not read from remote repository.”

直接翻译是 “远程仓库无法读取”。

为什么会无法读取呢?

1、无法链接服务器

  确认是可以连上服务器的。

2、IDEA中git集成中使用的ssh方式问题

windows下Idea使用git clone failed. Could not read from remote repository.

在解决问题的过程中看到stackoverflow中是让更改“SSH executable” 方式为 Native,试过无效。。。

3、无法通过SSH的链接验证。

  所以可以通过创建ssh key 并将产生的id_rsa.pub的内容加到gitlab的后台就可以解决问题了。

  a.产生key

ssh-keygen -t rsa -C "你的帐号名"

  生成过程采用默认方式,直接按enter键到生成id_rsa,id_rsa.pub

  将生成的id_rsa.pub中的内容添加到相应的git服务器,个人帐号里面。

  b.加key

  windows下Idea使用git clone failed. Could not read from remote repository.

返回顶部
顶部