git merge合并分支push报错:Your branch is ahead of 'xxx' by xx commits.
Your branch is ahead of 'xxx' by xx commits.
(use "git push" to publish your local commits)
解决方案:
git checkout 到要合入的分支,然后:
(1)
git merge 被合并的分支 --no-ff
(2)弹出的框需要输入提交信息,此时按键盘上的 Insert键,输入要提交message,
(3)上述的提交信息输入完成后,按住键 Ctrl + C停止输入。
(4)接着 输入 wq,退出。
随后正常push到远程即可。
如果过程中发生异常,无法正常进行,可放弃merge合并:
git merge --abort