精选文章 Transport Error: Cannot get remote repository refs.https://github.com/xxx/test1.git: cannot open git

Transport Error: Cannot get remote repository refs.https://github.com/xxx/test1.git: cannot open git

作者:木易月生丬匕 时间: 2021-02-05 09:43:12
木易月生丬匕 2021-02-05 09:43:12
【摘要】问题出现: 
  在eclipse中pull项目至github上出现该问题 
 
  
 查看报错日志 
org.eclipse.jgit.api.errors.TransportException: https://github.com/muzhiyi1996/test1.git: cannot open git-upload-pack at org.eclipse.jgit.api.Ls...

问题出现:

  在eclipse中pull项目至github上出现该问题

Transport Error: Cannot get remote repository refs.https://github.com/xxx/test1.git: cannot open git1

 

 查看报错日志

org.eclipse.jgit.api.errors.TransportException: https://github.com/muzhiyi1996/test1.git: cannot open git-upload-pack at org.eclipse.jgit.api.LsRemoteCommand.execute(LsRemoteCommand.java:222) at org.eclipse.jgit.api.LsRemoteCommand.call(LsRemoteCommand.java:161) at org.eclipse.egit.core.op.ListRemoteOperation.run(ListRemoteOperation.java:116) at org.eclipse.egit.ui.internal.components.RefSpecPage$2.run(RefSpecPage.java:255) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
Caused by: org.eclipse.jgit.errors.TransportException: https://github.com/muzhiyi1996/test1.git: cannot open git-upload-pack at org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:624) at org.eclipse.jgit.transport.TransportHttp.openFetch(TransportHttp.java:391) at org.eclipse.jgit.api.LsRemoteCommand.execute(LsRemoteCommand.java:200) ... 4 more
Caused by: java.net.ConnectException: Connection time out: github.com at org.eclipse.jgit.util.HttpSupport.response(HttpSupport.java:235) at org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:539) ... 6 more

 

经过百度后解决方案尝试如下:

  1. 日志显示连接超时,所以直接更改超时时间

  Preferences-->Team-->Git,修改为300

  该方法尝试无效

  Transport Error: Cannot get remote repository refs.https://github.com/xxx/test1.git: cannot open git2

 2.Preferences-->Team-->Git-->Configuration-->User Settings.然后点Add Entry新建一个键值对,输入http.sslVerify=false

  该方法尝试后无效

Transport Error: Cannot get remote repository refs.https://github.com/xxx/test1.git: cannot open git3

 

 

3.修改eclipse.ini文件

  在文件中添加  -Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2。

  这个问题是说旧版eclipse默认JDK版本是1.7,默认支持TLSv1.1,Git现在不支持该协议。而JDK版本是1.8的话,默认支持TLSv1.2,不会有该问题

  我的JDK版本是1.8,没有该问题,但还是将该方法放在此处,希望对他人有所帮助

4..Preferences-->General-->Network Connection,修改Active Provider为Direct

  该方法尝试后依旧无效

Transport Error: Cannot get remote repository refs.https://github.com/xxx/test1.git: cannot open git4

 

5.上述办法都无效后,在百度时突然想起来ping网址,因为我是能登录github.com的,所以一直没想到该问题,之后cmd-->ping github.com

Transport Error: Cannot get remote repository refs.https://github.com/xxx/test1.git: cannot open git5

 

 问题原因找到了,解决:

  https://www.ipaddress.com/ip-lookup 在该网址输入github.com,查出一个ip地址,

  打开C:\Windows\System32\drivers\etc\hosts文件,在末尾添加 ip地址+github.com

Transport Error: Cannot get remote repository refs.https://github.com/xxx/test1.git: cannot open git6

 

 Transport Error: Cannot get remote repository refs.https://github.com/xxx/test1.git: cannot open git7

 

 再次ping github

Transport Error: Cannot get remote repository refs.https://github.com/xxx/test1.git: cannot open git8

 

 问题解决!eclipse问题也解决

勿删,copyright占位
分享文章到微博
分享文章到朋友圈

上一篇:kubespray部署k8s version 1.0

下一篇:LeetCode 78 子集

您可能感兴趣

  • sOmE clues aBoUt how tO get oNe fUlLsEt of mAmE

    Some of sites you could find the scarced fullset of GREAT MAME were shown below. WHAT? You don't know what the GREAT MAME is? ah.....-_,-b Just Gooogle it or ....

  • 有关error 46 encountered when initializing ldm

    摘录自metalink 线索 状态: 活动的 来自: Mike Rudnik 20-May-04 05:55 主题: error 46 encountered when initializing ldm. RDBMS Version: 10.1.0.2.0Operating System and Version: Red Hat Enterprise Linux AS 3E...

  • BREW-开放的移动数据解决方案 An Open Solution for Mobile Data [对照文]

    话音业务作为移动通信运营商的基础业务,已经越来越难以用差异化的服务在激烈竞争的市场上获得竞争优势。而基于数据的新兴业务却以出色的前景成为各大运营商满足个性化服务要求的用户的关键应用。因应对个性化数据服务业务的要求,高通公司推出了BREW平台。BREW是一种技术,同时也是一种灵活的“一揽子”业务系统。它一方面为软件开发商及移动通信运营商提供灵活的开发及下载平台;另一方面为手机的用户提供一个能够...

  • https://XXX/.xml Error:800C000E

    HTTPS中用XMLHTTP对象访问XML时报错,解决方案如下: try{ var Req = Server.CreateObject("Msxml2.ServerXMLHTTP.4.0"); var URL = "https://someserver/a.xml"; Req.open("GET", URL, false); Req.setOption(2) = 13056 Req.se...

  • VB program 'Open the connection

    'Open the connection Private mConn As Connection Private XX As String XX="PROVIDER=MSDataShape;" XX= XX + "Data PROVIDER=Microsoft.Jet.OLEDB.4.0;" XX= XX + "Data Source=D:\Documents and Settin...

  • [C# WinForm] How to: Get the Name of a DataGrid Column

    This is a formidable mission!:) But a complex question always has a simple answer private void dataGrid1_MouseDown(object sender, MouseEventArgs e) {    DataGrid.HitTestInfo hti= ((Dat...

  • ORA-01658: 无法为表空间xxx中的段创建 INITIAL 区

    ORA-01658: 无法为表空间xxx中的段创建 INITIAL 区 [@more@] 今天重建索引就出现了这样的错误: sql>alter index t_xx rebuild partition t_xxx200603 tablespace idx_xxx200603; sql>ORA-01658: 无法为表空间idx_xxx200603中的段创建 INITIAL 区 后来查...

  • MS Windows CanonicalizePathName() Remote Exploit (MS06-040)

    /* Microsoft Windows CanonicalizePathName() Remote Overflow MSO6-040More info: http://www.microsoft.com/technet/security/bulletin/MS06-040.mspxWritten by Preddy This is another version of hdm's m...

CSDN

CSDN

中国开发者社区CSDN (Chinese Software Developer Network) 创立于1999年,致力为中国开发者提供知识传播、在线学习、职业发展等全生命周期服务。

华为云40多款云服务产品0元试用活动

免费套餐,马上领取!
Transport Error: Cannot get remote repository refs.https://github.com/xxx/test1.git: cannot open git介绍:华为云为您免费提供Transport Error: Cannot get remote repository refs.https://github.com/xxx/test1.git: cannot open git在博客、论坛、帮助中心等栏目的相关文章,同时还可以通过 站内搜索 查询更多Transport Error: Cannot get remote repository refs.https://github.com/xxx/test1.git: cannot open git的相关内容。| 移动地址: Transport Error: Cannot get remote repository refs.https://github.com/xxx/test1.git: cannot open git | 写博客