【问题标题】:git clone from bitbucket.org is not working by https来自 bitbucket.org 的 git clone 不适用于 https
【发布时间】:2014-03-20 07:11:56
【问题描述】:

我面临与Could not resolve host: bitbucket.org; nodename nor servname provided, or not known 相同的问题。我试过评论中给出的IP地址,但它也给出了同样的信息。请帮忙解决问题。 这是错误代码:

    MYNAME@DEVELOPER8 /d/Projects
    $ git clone https://MYNAME@bitbucket.org/PATH/TO/REPO.git
    Cloning into 'REPO'...
    fatal: unable to access 'https://MYNAME@bitbucket.org/PATH/TO/REPO.git/': Could not resolve host: bitbucket.org

【问题讨论】:

  • 如果您无法使用主机名,也无法使用 IP 地址,则似乎您没有连接到互联网。或者使用浏览器浏览某些网站是否有效?
  • 是的,互联网工作正常。也许是我必须解决的网络问题?
  • “无法解析主机”错误意味着互联网无法正常工作。你测试了什么?您可以在同一台 PC 上浏览bitbucket.org 吗?
  • 感谢 cmets,我的互联网连接不是很好,但我已经在 bitbucket.org 上冲浪了几次,它打开没有任何问题。
  • 您是否在使用公司代理?它是否在命令行中启用并正常工作?如果您在 linux 或 git bash 下,请在使用 http 的地址上尝试 wget 命令,然后使用 https。如果失败,请检查您的代理配置。

标签: git clone bitbucket


【解决方案1】:

有时我们会在配置代理时出错。 也许这可以帮助,重置您的代理。

git config --global --unset http.proxy
git config --global --unset https.proxy

【讨论】:

  • 请提供比代码 sn-p 更多的解释。这对我们来说可能很明显,但请帮助其他人让他们知道为什么这段代码回答了这个问题
  • 当然,我可以做到最好...@Jean-RémyRevy
  • 听起来更好。谢谢@andrewoodleyjr
【解决方案2】:

当您在 bitbucket 中创建存储库时,用户界面会显示您需要的确切克隆命令:

因此,您的克隆命令需要:

https://usersname@bitbucket.org/username/reponame.git

【讨论】:

    猜你喜欢
    • 2021-02-20
    • 2022-01-10
    • 2014-04-17
    • 1970-01-01
    • 1970-01-01
    • 2013-10-03
    • 1970-01-01
    • 2014-03-28
    • 1970-01-01
    相关资源
    最近更新 更多