我有点羞于承认到目前为止我使用了github desktop
我现在决定尝试使用 gh cli
我按照documentation安装
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0
sudo apt-add-repository https://cli.github.com/packages
sudo apt update
sudo apt install gh
明显成功$ which gh
/usr/bin/gh
$ gh --version
gh version 1.8.1 (2021-04-02)
https://github.com/cli/cli/releases/tag/v1.8.1
但是要克隆一个公共(public)仓库(例如 flutter gallery )运行 gh repo clone flutter/gallery
我收到以下错误Cloning into 'gallery'...
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.
exit status 128
(使用 gh-desktop
可以“开箱即用”地工作)我错过了什么?
github discussion
最佳答案
如果您有同样的问题,请先使用 ssh
检查。直接地:
ssh -T git@github.com
如果是这种情况,请检查您的 ~/.ssh
内容,并确保您拥有 added然后 tested一个 SSH key ,以便所述 key 从命令行工作(因为 GitHub Desktop 可能在 GitHub Desktop 应用程序内部管理自己的 key )
关于linux - `gh cli` 失败 `git@github.com: Permission denied (publickey)` 但 `gh desktop` 没有问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67038457/