我在使用 Git 将新分支推送/发布到 GitHub 存储库时遇到问题。
编辑:我发现我在这个仓库中的所有分支都遇到了这个问题。我还测试了其他存储库,他们正在按应有的方式推动更改。
尽管将 http.postBuffer 值增加到 1 GB,我仍然收到以下错误消息:
PS C:\path\ git push --set-upstream origin working_branch_app --verbose
Pushing to https://github.com/Skymero/WoundSize.git
Enumerating objects: 44290, done.
Counting objects: 100% (44290/44290), done.
Delta compression using up to 16 threads
Compressing objects: 100% (35065/35065), done.
Writing objects: 100% (44276/44276), 701.84 MiB | 124.79 MiB/s, done.
Total 44276 (delta 9221), reused 38538 (delta 7978), pack-reused 0 (from 0)
POST git-receive-pack (735935268 bytes)
error: RPC failed; curl 55 Send failure: Connection was reset
send-pack: unexpected disconnect while reading sideband packet
fatal: the remote end hung up unexpectedly
Everything up-to-date
我已尝试通过检查 GitHub 状态页面、我的网络连接并使用其他互联网服务提供商来解决该问题,但问题仍然存在。
我根据有关此问题的其他一些帖子以及 ChatGPT 的建议尝试了以下命令:
2 git push --set-upstream origin working_branch_app
3 git push origin main^8:main
4 git config --global core.compression 0
5 git push --set-upstream origin working_branch_app
6 git config --global http.postBuffer 157286400
7 git push --set-upstream origin working_branch_app
8 git config http.postBuffer 524288000
9 git push --set-upstream origin working_branch_app -f
10 git remote add origin [email protected]:Skymero/WoundSize.git
11 git remote add origin https://github.com/Skymero/WoundSize.git
12 git remote -v
13 git fetch
14 git push
15 git push --set-upstream origin working_branch_app
16 git remote remove origin
17 git remote add origin https://github.com/Skymero/WoundSize.git
18 git push --set-upstream origin main
19 git push --set-upstream origin working_branch_app
20 git init
21 git push --set-upstream origin working_branch_app
22 git config http.postBuffer 2147483648
23 git push --set-upstream origin working_branch_app
24 git add --all
25 git commit -m "temp commit"
26 git push
27 git help config
28 Get-History
29 git --version
30 git config --global --reset
31 git config --global --unset-all
32 git config --global --unset
33 git config --global -l
34 git config --global --unset http.postBuffer
35 git push --set-upstream origin working_branch_app
36 git ls-remote origin
37 git fetch
38 git fetch origin
39 git log origin/working_branch_app
40 git push --set-upstream origin working_branch_app --verbose
41 git config --global http.postBuffer 1048576000
42 git push --set-upstream origin working_branch_app --verbose
我在 Windows 10 上使用 Git 版本 2.34.1。
我还尝试使用 --verbose 标志推送更改,但它没有提供任何有助于诊断问题的附加信息。
还有其他人遇到过这个问题吗?任何帮助或指导将不胜感激。
其他 Stackoverflow 帖子似乎对这个问题最有用:
解决方案:
调整了 Git 的 Pack 和 Buffer 设置:
git config --global pack.windowMemory "100m"
git config --global pack.packSizeLimit "100m"
git config --global pack.threads "1"
git config --global http.postBuffer 209715200 # 200 MB
然后意识到由于某种原因没有设置 SSH 密钥并生成了一个新的。
Test-Path ~/.ssh/id_rsa.pub
ssh-keygen -t rsa -b 4096 -C "[email protected]"
确保 ssh agen 正在运行,然后将 ssh 私钥添加到代理中:
Start-Service ssh-agent
ssh-add ~/.ssh/id_rsa
测试连接:
ssh -T [email protected]
最后我尝试了另一次推送尝试,但出现以下错误:
PS C:\Users\MartinezR\WoundSize\WoundSize> git push origin main --force
Enumerating objects: 46274, done.
Counting objects: 100% (46274/46274), done.
Compressing objects: 100% (37861/37861), done.
Writing objects: 100% (46274/46274), 871.98 MiB | 9.33 MiB/s, done.
Total 46274 (delta 10659), reused 38766 (delta 7161), pack-reused 0 (from 0)
remote: Resolving deltas: 100% (10659/10659), done.
remote: warning: File .venv/Lib/site-packages/cv2/cv2.pyd is 71.00 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File efficientnetb3_deepskin_semantic.zip is 73.94 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File checkpoints/efficientnetb3_deepskin_semantic.h5 is 80.71 MB; this is larger than GitHub's recommended maximum file size of 50.00 M
remote: warning: File .venv/Lib/site-packages/clang/native/libclang.dll is 80.10 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: error: Trace: b881d3427e8c252783de34646ff6dc1637854a7dc76f497bebbb38bb8e2bebc3
remote: error: See https://gh.io/lfs for more information.
remote: error: File .venv/Lib/site-packages/tensorflow/python/_pywrap_tensorflow_internal.pyd is 943.41 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
To github.com:Skymero/WoundSize.git
! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'github.com:Skymero/WoundSize.git'
最终解决了一个错误却又发现了另一个错误。