git - Git推送失败:远程端意外挂断并且未能推送一些参考
问题描述
新的 git 用户在这里。
我曾经能够运行“git push”命令,但它突然停止工作。
$ git push origin master
Enumerating objects: 29, done.
fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly
error: failed to push some refs to 'https://<user_name>@bitbucket.org/<user_name>/<file_name>.git'
我已经为 Windows 更新了 Git
$ git --version
git version 2.19.1.windows.1
在添加、提交和推送之前我已经尝试过“git pull”
$ git pull
Already up to date.
我已经尝试过更大的缓冲区
$ git config http.postBuffer 100000000
我已经从我的项目中删除了一个大文件。不知道我还能做什么。
虽然我看到了一些帖子,其中包含我遇到的两个 git 错误之一(远程结束和推送 refs),但没有一个与我发生的事情完全匹配,也没有解决我的问题。
提前致谢!
编辑:我使用 Bitbucket,这个问题只发生在这台 Windows 机器上。在另一台运行 MacOS 的机器上没有问题。
如果有帮助,这是我在 Windows 机器上的 git 状态:
$ git status
On branch master
Your branch is ahead of 'origin/master' by 4 commits.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
解决方案
考虑到BitBucket 状态报告没有问题,您的 Windows 机器上肯定有问题。
首先尝试:
- 确保您确实使用 Git BFG删除了所有历史记录中的那个大文件,
- 使用带有简化 %PATH%的 CMD 会话推送。
尝试切换到 SSH URL 看看是否有任何改变
git push git@bitbucket.org:<user_name>/<file_name>.git master
我在 Windows 机器上有一些我不能丢失的本地更改
然后,作为一种解决方法,您可以创建一个本地 repo 包,将(一个)文件复制到您的 Mac,然后从中提取。然后从 Mac 上的本地仓库推送。
推荐阅读
- python - Pandas 使用 item() 从日期时间索引中给出整数
- c# - 无法在与枚举绑定的组合框中设置“SelectedValue”
- instagram - 我使用 Instagram API 中的哪个端点从关注的帐户中检索数据,例如他们拥有的关注者数量?
- geometry - 将一系列深度图和 x、y、z、theta 值转换为 3D 模型
- amazon-web-services - 是否应该在一批插入 dynamoddb 之前对项目进行洗牌?
- python - 烧瓶运行错误python,虚拟环境中没有名为flask的模块
- python - 列表索引超出范围 - 卡方检验
- ubuntu - 如何通过 anisble playbook 注释多行
- uwp - 如何以编程方式截取 uwp 应用程序 samsung odyssey 的屏幕截图?
- laravel - 将数据传递给 Laravel 中的扩展视图和子视图