简体   繁体   English

git@github.com:来自公共存储库的权限被拒绝(公钥)

[英]git@github.com: Permission denied (publickey) from public repository

I can not clone repositories from github even if there are public:我无法从 github 克隆存储库,即使有公共存储库:

git clone https://github.com/github/fetch.git
Cloning into 'fetch'...
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.

Everything works if I want to clone from eg bitbucket.如果我想从 bitbucket 克隆,一切正常。

You wrote clone command with https:// URL but Git started to clone with git@ scp-like SSH URL. This means you have url.….insteadOf section(s) in your Git configs that overwrite your URLs on the fly.您用url.….insteadOf https:// URL编写了克隆命令,但Git开始使用git@ SCP-Like SSH881657866602088。

Run跑步

git config --list --show-origin | grep -Fi insteadof

to find out where exactly is the problematic configuration and comment out or remove what you do not need now.找出有问题的配置的确切位置,然后注释掉或删除您现在不需要的配置。

Most probably you have a section like this in your global ~/.gitconfig :很可能你在全局~/.gitconfig中有这样的部分:

[url "git@github.com:"]
    insteadOf = https://github.com/

To remove it:要删除它:

git config --global --remove-section url.git@github.com:

Or use your editor to inspect and edit the file:或者使用您的编辑器检查和编辑文件:

git config --global --edit

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 git@github.com:权限被拒绝(公钥) - git@github.com: Permission denied (publickey) Git 子模块:git@github.com:权限被拒绝(公钥)。 致命:无法从远程存储库中读取 - Git submodule: git@github.com: Permission denied (publickey). fatal: Could not read from remote repository git@github.com:权限被拒绝(公钥)。 致命:无法从远程存储库读取 - git@github.com: Permission denied (publickey). fatal: Could not read from remote repository Git Submodule git@github.com:权限被拒绝(公钥)错误 - Git Submodule git@github.com: Permission denied (publickey) error 获取ssh git@github.com:权限被拒绝(公钥) - Fetching ssh git@github.com: Permission denied (publickey) git@github.com:权限被拒绝(公钥)错误 - git@github.com: Permission denied (publickey) ERROR 为什么 git@github.com:Windows 中的权限被拒绝(公钥)? - Why git@github.com: Permission denied (publickey) in windows? git@github.com:权限被拒绝(公钥)。 但是 ssh git@github.com 有效 - git@github.com: Permission denied (publickey) . But ssh git@github.com works git@github.com:使用纱线安装github js package时权限被拒绝(公钥) - git@github.com: Permission denied (publickey) when using yarn to install github js package 我收到此错误 git@github.com: Permission denied (publickey), 当我在新 Mac 上 git push 时 - I get this error git@github.com: Permission denied (publickey), when I git push on new mac
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM