【发布时间】:2025-12-21 11:55:11
【问题描述】:
我只有一个分支。用了几个月
git push origin master
提交到我的本地存储库。昨晚我对本地存储库进行了一些小改动并尝试使用相同的命令推送后,我收到了这个错误:
error: RPC failed; result=22, HTTP code = 411
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Everything up-to-date
我在 Google 上搜索并找到了诸如 this one 和 this one 之类的问题,但这些问题的答案都没有解决我的问题。
大部分答案都暗示了头部脱落的问题。然而,我不认为我的头是分离的。我也不认为我在错误的分支上(因为我只有一个分支......)
我做了一些实验来找出问题所在,以下是我得到的结果:
(1) 首先是我的git status 输出
# On branch master # Untracked files: # (use "git add <file>..." to include in what will be committed) # # egal.aux # egal.blg # egal.out # egal.pdf # egalcar.aux # egalcar.blg # egalcar.pdf nothing added to commit but untracked files present (use "git add" to track)
(2) 当我输入git reflog 时,我可以看到我所有的本地提交,但远程存储库不会更新。
(3) 当我输入git branch -a 时,我得到
* master remotes/origin/master
(4) 当我输入 git remote show origin 时,我得到了
* remote origin Fetch URL: http://github.com/CherryQu921/egaldoc_en Push URL: http://github.com/CherryQu921/egaldoc_en HEAD branch: master Remote branch: master tracked Local ref configured for 'git push': master pushes to master (fast-forwardable)
我认为最后一行输出(“fast-forwardable”)很奇怪,但我不确定是什么问题...
【问题讨论】:
-
fast-forwardable意味着您可以将本地更改推送到远程分支,没有犯罪:-)