【问题标题】:How to fix "fatal :unable to look up https (port 9418) (No such host is known)如何修复“致命:无法查找 https(端口 9418)(不知道这样的主机)
【发布时间】:2019-10-30 06:35:35
【问题描述】:

我正在尝试使用 git 推送:

git push -u origin --all

这是我的问题:

Fatal: unable to look up https (port 9418) (No such host is known. )

我跑ping github.com得到了IP,但不知道怎么处理。

【问题讨论】:

  • git remote -v ?
  • 抱歉我的错误。我修好了它。当我使用git remote -v 时,它会在这里显示origin git://https://anhbui2904@bitbucket.org/anhbui2904/sample_app.git (fetch) origin git://https://anhbui2904@bitbucket.org/anhbui2904/sample_app.git (push) 对我有什么想法吗?

标签: ruby-on-rails ruby git github


【解决方案1】:

你有一个错误的远程 URL - git:// 是 Git 协议的名称(端口 9418),它不需要跟不同的协议名称。

试试这个:

git remote set-url origin https://anhbui2904@bitbucket.org/anhbui2904/sample_app.git

这会将您的 origin 远程 URL 设置为使用 HTTPS。

【讨论】:

    【解决方案2】:

    如果git remote set-url origin不起作用,您可以直接编辑

    .git/config

    文件,并将 git://https:// 前缀修复为所需的 git:// 或 https://

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-06-16
      • 2015-10-04
      • 2021-11-17
      • 2020-06-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多