[英]Ubuntu wsl2 git getting "The remote end hung up unexpectedly" on large repos
[英]git push in WSL2 environment hang up during Writing Objects step
我在 WSL2 环境中有一个 git 工作区。 工作区位于/mnt/c/workspace/repo下,从 Windows 通过路径C:\workspace\repo也可以看到。
当我在工作区中从 WSL2 侧执行 git 推送时,Git 会挂断此消息。
Enumerating objects: 39, done.
Counting objects: 100% (39/39), done.
Delta compression using up to 16 threads
Compressing objects: 100% (24/24), done.
Writing objects: 34% (9/26)
这是在此上下文中观察到的其他行为和环境信息。
$ git config --global --list
user.email=<my mail address>
user.name=<my name>
http.postbuffer=524288000
git config --global http.postBuffer 524288000
我在stackoverflow的不同问题中遵循了这个答案。 https://stackoverflow.com/a/26663047/3200358
这种解决方法对我不起作用。
我已经按照这个解决方法来修复 Windows 端的一些权限问题。 https://stackoverflow.com/a/63483040/3200358
attrib -r +s C:\workspace\repo
这种解决方法对我不起作用。
我试过 sudo git push 以防 git 命令无法访问某些锁定文件。
sudo GIT_SSH_COMMAND='ssh -i /home/<username>/.ssh/id_rsa' git push origin master
这种解决方法对我不起作用。
错误消息已更改。 但是这种解决方法对我不起作用。
$ git push --set-upstream origin master -vvvv
Pushing to https://github.com/kyasbal-1994/<repo-name>.git
Enumerating objects: 39, done.
Counting objects: 100% (39/39), done.
Delta compression using up to 16 threads
Compressing objects: 100% (24/24), done.
Writing objects: 100% (26/26), 5.53 MiB | 7.42 MiB/s, done.
Total 26 (delta 6), reused 0 (delta 0)
POST git-receive-pack (5802813 bytes)
error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: CANCEL (err 8)
fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly
Everything up-to-date
您是否尝试过使用 Windows git.exe
git
实际上,您可以在.bashrc
中设置别名:
alias wgit='/mnt/c/path\ to\ git/Git/git.exe`
This way, you have a Windows executable dealing with Windows files instead of a Linux executable dealing with Windows files, though I'm a little fuzzy on how things work with the mounting.
但是,我不确定输入路径时这可能对用户有多友好。
假设可行,甚至可能有一种方法可以在 bash 中编写智能包装器 function 来检测存储库所在的文件系统并调用正确的 ZBA9F11ECC3497D9993B933FDC2BD6...
作为替代方案,您可能会更幸运地维护 2 个独立的存储库(WSL 和 Windows),然后通过服务器的推/拉同步。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.