【发布时间】:2017-12-06 23:28:13
【问题描述】:
我有两个不同的问题,解决其中任何一个问题对我都有很大帮助。我正在尝试推送我对 git 存储库所做的一些更改,但我似乎无法完成两项工作。
我尝试的第一种方法是使用我一直在做的命令:
git push
但这会在提交过程中挂起大约 30%。根据我在网上找到的一些帖子,我确信这是 HTTP 连接的问题。我尝试使用:
git push --verbose --progress
它总是卡在
Pushing to https://github.com/my-account/my-repo.git
Counting objects: 87, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (66/66), done.
POST git-receive-pack (chunked)476.45 MiB | 29.64 MiB/s
我没有有任何大文件,所以我不确定是什么问题。 在查看了一些 StackOverflow 页面后,我尝试使用:
git config http.postBuffer 524288000
这是(我认为)应该阻止它将数据分块到缓冲区并允许更大的文件通过,但我没有改变。 然后我尝试更新我的 git 版本(它是 2.10.something,现在是 2.13.1),但这并没有改变任何东西。
有人建议使用 SSH,但我似乎无法让我的 SSH 密钥工作。我尝试使用:
git push -v ssh://my-account@github.com/my-repo.git
但我总是得到错误:
Pushing to ssh://my-account@github.com/my-repo.git
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
所以我不遗余力地试图让这个东西正常工作,甚至重新生成我的密钥并用我的帐户重新注册它,确保编辑配置以确保它一切正常。已验证;命令
ssh -T git@github.com
返回
Hi my-account! You've successfully authenticated, but GitHub does not provide shell access.
但是,当然,
git push -v ssh://my-account@github.com/my-repo.git
返回与以前相同的错误,Permission Denied。关于如何解决 SSH 验证问题或 HTTP 缓冲问题的任何想法?
【问题讨论】:
-
通常(公钥)意味着您尚未将私有 RSA 密钥添加到您的 github 帐户或相应的 repo。这个仓库是私有的吗?
-
是的,repo 是私有的。我已经将我的密钥添加到我的 github 帐户中,除非我设法做错了。我的 id_rsa 指纹存储在 SSH 密钥下。
-
通常你推送到一个分支名称。您是否尝试过指定分支?
-
刚试了一下,没有变化。
-
你从哪里得到那个 URL 的? Github URL 看起来像这样:
git@github.com:my-account/repo.git