git报错Please enter a commit message to explain why this merge is necessary

问题:

多人联合开发时,经常在你git pull和git push之间有其他人push了新代码,不可避免的会遇到如下问题。

Merge branch 'main' of https://gitlab.rd.test.com/iOS/SideB/TestDemo
# 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.
~                                                                                    
~                                                                                                                                                               
"~/Documents/TestDemo/.git/MERGE_MSG" 6L, 313B

解决:

按“ESC”键后输入“:wq”后回车解决

:wq 强制性写入文件并退出(存盘并退出 write and quite)

TO:

【Linux】vi编辑器中:wq 、:wq!、:x、:q、:q!的详细区别

猜你喜欢

转载自blog.csdn.net/u012881779/article/details/129790396
今日推荐