git - 来自 Visual Studio Code 的 Git 推送提供“远程:无匿名写访问”
问题描述
当我遇到此错误时,我正在尝试从存储库中推送代码:
没有匿名写访问权限。
我已经按照Visual Studio Code 的 Git 推送中提到的步骤进行操作:“没有匿名写访问。身份验证失败” ,但我仍然遇到了同样的错误。
我需要对该问题中提到的过程进行一些澄清。
完成后cat ~/.ssh/id_ed25519.pub
,我看到了格式中的关键
ssh-ed25519 <key> <email>
我是否需要将整个内容复制到key field
GitHub 帐户中,例如密钥 + 电子邮件或仅密钥?
除了澄清之外,还有其他解决方案吗?
我根据收到的答案复制了所有内容。但是随后,我将遥控器从 ahttps
更改为ssh
链接,然后在推送时出现此错误:
sign_and_send_pubkey: signing failed: agent refused operation
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.
解决方案
澄清:将整个内容复制到 GitHub 帐户的 key 字段中。
ssh-ed25519 <key> <email>
如果按照链接中给出的教程后错误仍然存在,则将存储库的远程从更改
https
为ssh
使用git remote set-url origin git@github.com:<username>/<reponame>.git
现在如果你遇到错误
sign_and_send_pubkey: signing failed: agent refused operation 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.
永远不要忘记在推送代码的地方添加 SSH 密钥:
ssh-add
推荐阅读
- android - Android Studio - 属性 android... 在这里不允许 - AndroidManifest.xml
- java - 按孩子的最大日期排列的订单列表(使用 Hibernate Critéria)
- python - GCP云函数双函数调用
- numpy - 如何将 np.where 函数与数组每个元素的索引一起使用?
- node.js - 尝试在 Publisher 中进行高级自定义 UI 时如何解决 NPM 错误
- python - 无法转换 numpy.object_ 类型的 np.ndarray
- python - 如何解决错误 TypeError: unsupported operand type(s) for /: 'Dimension' and 'float'
- c# - 进行一些图形调用后返回成功/错误响应
- javascript - 未调用模拟 res.status 上的快速控制器 getAllUsers 函数的开玩笑单元测试失败?
- jquery - Google Places api 按类型获取地址组件