我使用 ssh 和 RSA 密钥来访问 github,但是当我将文件推送到存储库时它不起作用。
somename54@THISPC:~/repos/homework-1-name54$ git push
Enumerating objects: 6, done.
Counting objects: 100% (6/6), done.
Delta compression using up to 12 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 2.79 KiB | 2.79 MiB/s, done.
Total 4 (delta 0), reused 0 (delta 0)
fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly
Connection to github.com closed by remote host.
我怎样才能解决这个问题?
您可以使用这个问题作为参考:Git,致命:远程端意外挂断
- 一些用户面临这个问题是由于缓冲区设置造成的:例如
git config ssh.postBuffer 524288000
- you may have misconfigured you remote in the repo (you can check with
git remote -v
) or the ssh keypair
- 您可以删除 ssh 源并将其替换为 http
- 您可能忘记将 ssh 密钥添加到您的代理(
ssh-add ~/.ssh/id_rsa
)
- 您可以重新运行 github 文档中描述的步骤https://docs.github.com/en/github/authenticating-to-github/generate-a-new-ssh-key-and-adding-it-to-the-ssh-agent
- 在其他情况下,运行垃圾收集器修复了问题(
git gc
)
- 如果您以 root (sudo) 创建存储库并且为您的用户安装了 git,则您可能缺少写入权限
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)