【问题标题】:I pasted Github git URL for cloning but get: Could not resolve host: github.com我粘贴了用于克隆的 Github git URL,但得到:无法解析主机:github.com
【发布时间】:2020-11-03 14:30:17
【问题描述】:

我粘贴了 HTTP 但它不起作用。

$ git clone https://github.com/Msajjad313/coursera-test1.git
Cloning into ‘coursera-testi’...
Fatal: unable to access 'https://github.com/Msajjad313/coursera-test1.git/': Could not resolve host: github.com

【问题讨论】:

标签: github


【解决方案1】:

您尝试访问的内容可能不公开,因此如果可以从您的 git 帐户访问,则您必须通过终端登录到您的 git 帐户。

第一:git config --global user.name "your_username"

然后:git config --global user.email "your_email_address@example.com"

您可以按照流程了解更多信息HERE

【讨论】:

  • repo 没有问题,我可以克隆它没有问题。无需设置凭据
【解决方案2】:
Could not resolve host: github.com

表示您有 DNS 或防火墙问题。

从命令行尝试:

ping github.com

repo 没有问题,我可以克隆它没有问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-10-15
    • 2013-12-20
    • 1970-01-01
    • 2015-02-27
    • 1970-01-01
    • 2021-01-28
    • 1970-01-01
    • 2021-01-10
    相关资源
    最近更新 更多