我如何解决:“无法打开 'git-upload-pack'” eclipse 中的错误?

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

How Can I Resolve:"can not open 'git-upload-pack' " error in eclipse?

git

提问by ewom2468

I am building an android app with the facebook api and I need to import the facebook android sdk. When I want to import this file from github it throws the .."can not list the available branches..'can not open git-upload-pack'"...the detailed error was now:

我正在使用 facebook api 构建一个 android 应用程序,我需要导入 facebook android sdk。当我想从 github 导入这个文件时,它会抛出 .."can not list the available branch..'can not open git-upload-pack'" ...现在的详细错误是:

https://github.com/facebook/facebook-android-sdk/: cannot open git-upload-pack
java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

Please, how can I resolve this?"

请问,我该如何解决?”

采纳答案by knittl

You are using the wrong URL (you are using the URL for the html webpage). Try either of these instead:

您使用了错误的 URL(您使用的是 html 网页的 URL)。请尝试以下任一方法:

  • https://github.com/facebook/facebook-android-sdk.git
  • git://github.com/facebook/facebook-android-sdk.git
  • https://github.com/facebook/facebook-android-sdk.git
  • git://github.com/facebook/facebook-android-sdk.git

回答by arashi01

I also came across this issue trying to push via https to a repo using a self-signed SSL certificate.

我在尝试使用自签名 SSL 证书通过 https 推送到存储库时也遇到了这个问题。

The solution for me was running (from the local repository root):

我的解决方案正在运行(从本地存储库根目录):

git config http.sslVerify false

回答by user907957

This works for me: http://gitblit.com/setup_client.html

这对我有用http: //gitblit.com/setup_client.html

Eclipse/EGit/JGit

Eclipse/EGit/JGit

Window->Preferences->Team->Git->Configuration
Click the New Entry button

Key = http.sslVerify
Value = false

回答by tigersagar

I was getting the same issue "Cannot open git-upload-pack" in eclipse Juno while trying to clone ('Git Repository Exploring' perspective). https://[username]@[hostName]:[portNumber]/scm/TestRepo.git

我在尝试克隆时在 Eclipse Juno 中遇到了同样的问题“无法打开 git-upload-pack”(“Git Repository Exploring”视角)。 https://[用户名]@[主机名]:[端口号]/scm/TestRepo.git

Solution: Issue got solved after adding "-Dhttps.protocols=TLSv1" to the eclipse.ini file.

解决方案:在 eclipse.ini 文件中添加“-Dhttps.protocols=TLSv1”后问题得到解决。

Possible Reason for Error: Some servers does not support TLSv1.2, or TLSv1.1, they might support only TLSv1.0. Java 8 default TLS protocol is 1.2 whereas it is 1.0 with Java 7. For an unknown reason, when Egit connects to the server, it does not fallback to TLSv1.1 after TLS1.2 fails to establish the connection. Don't know if it's an Egit or a Java 8 issue Courtesy : https://www.eclipse.org/forums/index.php/t/1065782/

可能的错误原因:某些服务器不支持 TLSv1.2 或 TLSv1.1,它们可能只支持 TLSv1.0。Java 8 默认的 TLS 协议是 1.2,而 Java 7 是 1.0。不知什么原因,当 Egit 连接到服务器时,它不会在 TLS1.2 建立连接失败后回退到 TLSv1.1。不知道是 Egit 还是 Java 8 问题礼貌:https://www.eclipse.org/forums/index.php/t/1065782/

回答by Scott Warren

I had the same problem when my network config was incorrect and DNS was not resolving. In other words the issue could arise when there is no Network Access.

当我的网络配置不正确且 DNS 无法解析时,我遇到了同样的问题。换句话说,当没有网络访问时可能会出现问题。

回答by Sam Jason Braddock

This is a quite old post, but:

这是一个很老的帖子,但是:

  • never oh never disable ssl verify as suggested in some answers

  • if you want to stick with https:

    1. retrieve add your git server certificate (using firefox for example)
    2. add it to your java keystore. See https://stackoverflow.com/a/27928213/5423781
  • 永远不要按照某些答案中的建议禁用 ssl 验证

  • 如果你想坚持使用 https:

    1. 检索添加您的 git 服务器证书(例如使用 firefox)
    2. 将其添加到您的 Java 密钥库中。见https://stackoverflow.com/a/27928213/5423781

回答by RahulMohan Kolakandy

to fix SSL issue you can also try doing this.

要解决 SSL 问题,您也可以尝试这样做。

Download the NetworkSolutionsDVServerCA2.crt from the bitbucket server and add it to the ca-bundle.crt

从 bitbucket 服务器下载 NetworkSolutionsDVServerCA2.crt 并将其添加到 ca-bundle.crt

ca-bundle.crt needs to be copied from the git install directory and copied to your home directory

ca-bundle.crt 需要从 git install 目录复制到你的主目录

cp -r git/mingw64/ssl/certs/ca-bundle.crt ~/

cp -r git/mingw64/ssl/certs/ca-bundle.crt ~/

then do this. this worked for me cat NetworkSolutionsDVServerCA2.crt >> ca-bundle.crt

然后这样做。这对我有用 cat NetworkSolutionsDVServerCA2.crt >> ca-bundle.crt

git config --global http.sslCAInfo ~/ca-bundle.crt

git config --global http.sslCAInfo ~/ca-bundle.crt

git config --global http.sslverify true

git config --global http.sslverify true

回答by RANA DINESH

Adding the option insides Eclipse immediately resolves the issue. To add the option

在 Eclipse 中添加该选项可立即解决该问题。添加选项

open preferences via application menu Window => Preferences (or on OSX Eclipse => Settings). Navigate to Team => Git => Configuration click Add entry..., then put http.sslVerify in the key box and false in the value box.

通过应用程序菜单窗口 => 首选项(或在 OSX Eclipse => 设置上)打开首选项。导航到 Team => Git => Configuration 单击 Add entry...,然后将 http.sslVerify 放入 key 框中,并将 false 放入 value 框中。

回答by James Franken

Check to see if the user is suspended in GitHub. Access their user page and if a banner is across the top of the page that says, "This user is suspended." that is probably your issue.

检查用户是否在 GitHub 中被暂停。访问他们的用户页面,如果页面顶部有一个横幅,上面写着“此用户已被暂停”。那可能是你的问题。

回答by Savandy

Just disable IPv6on the network configuration

只是禁用IPv6network configuration

Screenshot of my network configuration

我的网络配置的屏幕截图