【发布时间】:2026-01-09 11:20:09
【问题描述】:
最近我尝试在装有 Sierra 10.12.5 的 MacBook Pro 中使用 git。 git 在 Mavericks 中毫无怨言地使用,但是,它给出了问题 现在在 git push 中。
注意
在 SO 和 google 中确实存在许多相似和相同的问题,
但它们都不适合我。
如果有人建议解决我的问题的链接,我会很乐意删除我的问题,无需投票,这个问题对我来说需要很多时间。
这似乎是一个愚蠢的问题,只是无法推送到 git hub repo, 不过承认不承认,这也是目前困扰我的问题。
谢谢你的帮助,如果你能帮忙的话。
错误:
ERROR: Permission to XXX.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
到目前为止所做的事情:
复制
~/.ssh/id_rsa.pub的内容 到 GITHUB/Settings/SSH 和 GPG 密钥/新密钥-
测试
ssh -T git@github.com
给予:
Hi USERNAME! You've successfully authenticated, but GitHub does not provide shell access.
-
然后我从我的 GitHub 帐户中克隆了一个练习仓库:
git clone git@github.com:bhishan2/practice.git.
cd 练习。
触摸 example.txt。
git add example.txt.
git commit -m "添加了一个文件"
git push 起源大师。
现在我得到了上述错误。
我们如何解决这个错误?
相关链接:
git: fatal: Could not read from remote repository
https://community.atlassian.com/t5/Bitbucket-questions/git-pull-fatal-Could-not-read-from-remote-repository/qaq-p/122111
https://github.com/jakubroztocil/cloudtunes/issues/23
我们将不胜感激。
【问题讨论】:
-
git remote show origin显示什么? -
尝试使用 https 而不是 SSH,看看是否能够推送到 repo
-
试试
GIT_SSH_COMMAND="ssh -vvv" -
谢谢大家,我解决了这个问题。
标签: git github ssh macos-sierra git-push