Git推送到新的远程错误 [英] Git pushing to new remote error
本文介绍了Git推送到新的远程错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个本地Git存储库,硬盘上有一个现有的遥控器。现在,我想将存储库移动到GitHub,并按照文档执行了以下操作:
git remote set-url origin https://github.com/xxx/xxx.git
git push -u origin master
但我收到错误。
[user@machine folder]$ git push -u origin master
Username:
Password:
Counting objects: 7398, done.
Delta compression using up to 12 threads.
Compressing objects: 100% (2575/2575), done.
error: RPC failed; result=22, HTTP code = 0iB | 367.95 MiB/s
fatal: The remote end hung up unexpectedly
Writing objects: 100% (7398/7398), 506.65 MiB | 367.95 MiB/s, done.
Total 7398 (delta 5083), reused 6965 (delta 4677)
fatal: The remote end hung up unexpectedly
fatal: expected ok/error, helper said '2004k¡oe>�Xx�FV.�Na�D�͂'
fatal: write error: Broken pipe
我在堆栈溢出上发现的大多数问题都通过
解决了git config http.postBuffer 524288000
但这对我没有帮助
我还尝试了git repack
,这只是让错误出现得更快(打印出来的废话也少了一点)。
在git repack
之前错误如下:
[user@machine folder]$ git push -u origin master
Username:
Password:
Counting objects: 7398, done.
Delta compression using up to 12 threads.
Compressing objects: 100% (2771/2771), done.
error: RPC failed; result=22, HTTP code = 0iB | 11.89 MiB/s
fatal: The remote end hung up unexpectedly
Writing objects: 100% (7398/7398), 506.60 MiB | 11.46 MiB/s, done.
Total 7398 (delta 5084), reused 6454 (delta 4481)
fatal: The remote end hung up unexpectedly
*�{�����@���߫��l�|ʫ%r, helper said '2004�*U��m
��EE$�%��M�l��yx�=�O�X.d (Y�gc�Ͷ�Ri�+�ONa���'���F�2X�P������~�,�rݐ����_�,����n0��~8(��v��_�lꉋ�=C�����M�ݓYP���ЖO�e�t-����2X��s�Ϲ۱�<�o|�+�6x1�ob��v>�s��'
在这一点上,我非常绝望。有人知道如何将本地Git存储库推送到GitHub吗?
推荐答案
可能是由于以下几个问题:
存储库大小限制
- GitHub将其存储库大小限制为GB(您的存储库大小为~500MB)
- GitHub将单个文件的最大大小限制为100MB
https://help.github.com/articles/working-with-large-files/
git config http.postBuffer 524288000
您设置的此配置只是增加了Git在将数据发送到Web时使用的缓冲区大小
http.postBuffer
将数据发布到远程系统时智能HTTP传输使用的最大缓冲区大小(以字节为单位)。对于大于此缓冲区大小的请求,使用HTTP/1.1和Transfer-Ending:Chunked来避免在本地创建大量的包文件。默认为1 MiB,足以满足大多数请求。
错误的远程配置。
尝试使用以下命令设置遥控器:git remote add origin https://github.com/xxx/xxx.git
,以及您已添加的set-url
。
您的代理设置
在某些代理中,对POST文件的大小有限制,因为您的存储库很大(>;500MB),这里可能就是这种情况。
要做什么?
尝试逐一消除上述可能出现的问题
- 提交较少的文件并尝试提交它们。如果这起作用,则问题出在通过网络发送的包文件的大小上。
- 使用
gc --aggressive --prune=now
清理存储库
这篇关于Git推送到新的远程错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文