【问题标题】:Git hub getting error while push the code in repostory?将代码推送到存储库中时,Github 出现错误?
【发布时间】:2020-01-21 10:00:18
【问题描述】:

我在 GitHub 上创建了一个新帐户并创建了一个新存储库。现在我想将我的 localhost 项目推送到该存储库中。

默认情况下它显示主分支,当我尝试推送代码时在命令行中收到此错误:

git@GitHub.Com: Permission denied (public key).
fatal: Could not read from remote repository. 

这些是命令:

git add .
git commit -m "this is my first commit"
git pull origin master

我不确定为什么会出现此错误。

【问题讨论】:

标签: git github


【解决方案1】:

检查您的公钥是否已正确添加到您的 github 帐户中。

然后正确添加验证远程。

git remote -v

验证上述内容后,尝试拉或推。

【讨论】:

  • “检查你的公钥是否正确添加到你的 github 帐户中”你能告诉我如何添加密钥吗?
  • 或者使用https而不是ssh(然后你可以使用你的密码push(而不是pull))
猜你喜欢
  • 1970-01-01
  • 2019-11-06
  • 1970-01-01
  • 2012-05-04
  • 2018-08-02
  • 2021-12-22
  • 2013-02-14
  • 2023-03-16
  • 1970-01-01
相关资源
最近更新 更多