git 冲突,Merge
问题
Merge branch 'develop' of https://gitee.com/beihangya/c-4
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit. 如何理解
这是 Git 在让你写合并提交(merge commit)的说明文字。
场景 ,执行了
git pull origin develop
而本地 develop
分支比远程多出了一些自己的提交,Git 只好把远程的新提交与你的提交做了一次合并(merge),于是弹出这个编辑器窗口,要求你记录这次合并的理由。
解决方案:
-
直接保存退出(空消息会中止合并)
在 vim 下按:wq
回车即可;
其他编辑器保存后关闭窗口。 -
想写点说明(可选)
把第二行改成中文或英文,例如:Merge remote develop into local developResolve conflict in TcpServer.hpp
然后保存退出。