为什么我无法 git Push 到我的存储库?

问题描述 投票:0回答:1

我在使用 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\USER\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'

最终解决了一个错误却又发现了另一个错误。对于这个错误,我尝试了太多的方法但没有结果。最后,我最终删除了电脑中的所有内容并再次克隆了存储库,因为我没有任何重大更改要添加。


不幸的是这个解决方案不是解决方案。解决问题后,我生成了一个新的 venv 并安装了一些我需要的软件包,但随后出现了以下错误,考虑到我之前安装过这些软件包并且从未遇到过这些问题,这对我来说很奇怪。很明显,它正在谈论由于大文件而不允许它通过,但同样,我已经在其他项目中安装了这些相同的软件包,没有出现问题,并且我通过测试这些其他项目进行了双重检查。此时我被困住了。我还尝试将它抱怨的文件添加到我的 .gitignore 文件中,但它们也没有被 gitignored。

(.myenv) PS C:\Users\USER\WoundSize> git push
Enumerating objects: 13253, done.
Counting objects: 100% (13253/13253), done.
Compressing objects: 100% (9613/9613), done.
Writing objects: 100% (13251/13251), 1.22 GiB | 8.44 MiB/s, done.
Total 13251 (delta 3231), reused 12484 (delta 2639), pack-reused 0 (from 0)
remote: Resolving deltas: 100% (3231/3231), completed with 1 local object.
remote: warning: File .myenv/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: cbf74495c52182f70af15700a2dbd684700dbe102111ea690952805ba3263cd9
remote: error: See https://gh.io/lfs for more information.
remote: error: File .myenv/Lib/site-packages/tensorflow/python/_pywrap_tensorflow_internal.pyd is 868.21 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]   globalmed_branch -> globalmed_branch (pre-receive hook declined)
error: failed to push some refs to 'github.com:Skymero/WoundSize.git'

我尝试安装的软件包列表

absl-py==2.1.0
alabaster==0.7.16
asttokens==2.4.1
astunparse==1.6.3
attrs==24.2.0
babel==2.16.0
beautifulsoup4==4.12.3
bleach==6.1.0
certifi==2024.8.30
charset-normalizer==3.3.2
colorama==0.4.6
comm==0.2.2
contourpy==1.3.0
cycler==0.12.1
debugpy==1.8.6
decorator==5.1.1
deepskin @ file:C:/Users/MartinezR/WoundSize/Deepskin
defusedxml==0.7.1
docutils==0.20.1
exceptiongroup==1.2.2
executing==2.1.0
fastjsonschema==2.20.0
filelock==3.16.1
flatbuffers==24.3.25
fonttools==4.54.1
gast==0.6.0
gdown==5.2.0
google-pasta==0.2.0
grpcio==1.66.1
h5py==3.12.1
idna==3.10
imagesize==1.4.1
ipykernel==6.29.5
ipython==8.27.0
jedi==0.19.1
Jinja2==3.1.4
joblib==1.4.2
jsonschema==4.23.0
jsonschema-specifications==2023.12.1
jupyter_client==8.6.3
jupyter_core==5.7.2
jupyterlab_pygments==0.3.0
keras==2.8.0
kiwisolver==1.4.7
libclang==18.1.1
mahotas==1.4.18
Markdown==3.7
markdown-it-py==3.0.0
MarkupSafe==2.1.5
matplotlib==3.9.2
matplotlib-inline==0.1.7
mdurl==0.1.2
mistune==3.0.2
ml-dtypes==0.4.1
namex==0.0.8
nbclient==0.10.0
nbconvert==7.16.4
nbformat==5.10.4
nbsphinx==0.8.7
nest-asyncio==1.6.0
numpy==1.26.4
opencv-python==4.10.0.84
opt_einsum==3.4.0
optree==0.12.1
packaging==24.1
pandas==2.2.3
pandocfilters==1.5.1
parso==0.8.4
pillow==10.4.0
platformdirs==4.3.6
pockets==0.9.1
prompt_toolkit==3.0.48
protobuf==4.25.5
psutil==6.0.0
pure_eval==0.2.3
Pygments==2.18.0
pyparsing==3.1.4
PySocks==1.7.1
python-dateutil==2.9.0.post0
pytz==2024.2
pywin32==306
pyzmq==26.2.0
referencing==0.35.1
requests==2.32.3
rich==13.8.1
rpds-py==0.20.0
scikit-learn==1.5.2
scipy==1.14.1
six==1.16.0
snowballstemmer==2.2.0
soupsieve==2.6
Sphinx==7.4.7
sphinx-rtd-theme==2.0.0
sphinxcontrib-applehelp==2.0.0
sphinxcontrib-devhelp==2.0.0
sphinxcontrib-htmlhelp==2.1.0
sphinxcontrib-jquery==4.1
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-napoleon==0.7
sphinxcontrib-programoutput==0.17
sphinxcontrib-qthelp==2.0.0
sphinxcontrib-serializinghtml==2.0.0
stack-data==0.6.3
tensorboard==2.17.1
tensorboard-data-server==0.7.2
tensorflow==2.8.0
tensorflow-intel==2.8.0
tensorflow-io-gcs-filesystem==0.31.0
termcolor==2.4.0
threadpoolctl==3.5.0
tinycss2==1.3.0
tomli==2.0.1
tornado==6.4.1
tqdm==4.66.5
traitlets==5.14.3
typing_extensions==4.12.2
tzdata==2024.2
urllib3==2.2.3
wcwidth==0.2.13
webencodings==0.5.1
Werkzeug==3.0.4
wrapt==1.16.0
git github rpc git-push
1个回答
0
投票

好吧。我现在已经可以使用了。

我也在 Reddit 上发布了这条评论,并有人给了我一些我需要听到的建议。

“您不在计算机之间使用 venv,您应该始终重新创建它。”

我总是将虚拟环境添加到我的 github 存储库中,但由于我遇到的明显原因,这显然不是常见做法。

因此,我将 venv 添加到 .gitignore 文件中,并创建了一个 bash 脚本来设置环境。

事实证明这是一个菜鸟问题。

© www.soinside.com 2019 - 2024. All rights reserved.