首页 > 解决方案 > git push 出错 [致命:远程端意外挂断]

问题描述

我的分支名称是大写的,比如 ABC。我误用了小写字母 abc。

git check out abc

即使在小写分支(abc)下,它仍然可以与 rebase 一起使用。rebase后,我开始推送代码,

git push origin ABC -f

得到错误,

致命:远端意外挂断

然后我查看了大写名称分支 ABC。推送时仍然出现错误。

我发现另一篇帖子讨论了它,但没有解决我的问题。 Git:合并后“主无法解析为分支”

标签: git

解决方案


I tried this out.

Delete the false brach, abc.

git branch -d abc

Push the correct one,

git push origin ABC -f

error: src refspec ABC does not match any.

Then checkout ABC again,

git checkout ABC

Then push it again,

git push origin ABC -f

推荐阅读