【问题标题】:Can't clone public git repositories via https无法通过 https 克隆公共 git 存储库
【发布时间】:2023-01-11 17:32:03
【问题描述】:

混帐:v2.39.0.2

可悲的是我不能克隆上市和通过 https 的私人回购,我不知道为什么。 通过 http 克隆有效。

我在我的 git bash 中尝试了git clone https://github.com/espressif/esp-idf.git,输出如下:

Cloning into 'esp-idf'...
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

有没有人提示我可以从哪里开始调试问题?我什至不知道去哪里搜索。

我重新安装了 git 但仍然得到相同的结果。

【问题讨论】:

  • 似乎 https url 自动替换为 ssh url。运行git config -l,检查是否有包含insteadof的值。
  • 你救了我的一天!很久以前我的配置中有一个insteadof,我在那里尝试了一些东西。你想把它写成答案,这样我可以接受吗? (不能用评论来做)

标签: git https git-bash


【解决方案1】:

似乎 https url 自动替换为 ssh url。运行git config -l并检查是否有包含insteadof的值。

您可以删除或注释掉该值以取消效果。

【讨论】:

  • 谢谢,解决了我的问题!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-11-01
  • 1970-01-01
  • 2012-02-28
  • 1970-01-01
相关资源
最近更新 更多