我正在编写一个脚本,逐步将Linux内核合并到一个从旧版本分支出来并稍作修改的分支中。
因此,我的脚本中有许多git merge <sha> -m "merge without conflict"
命令。如果存在冲突,则脚本会停止,等待用户解决并使用适当的消息提交合并。
然而,git merge -m "message" ...
仍然会弹出编辑器,强制我确认消息。如何防止这种情况发生?
我知道通常不建议使用非描述性的合并消息,但是这个合并没有产生冲突,可能会发生数百次,因此每次都要求用户(我自己)确认是不可行的。
编辑:这并不总是这样。但是,可以重现该问题:
# Clone Linux's repository
$ git checkout v2.6.38
$ git checkout -b test
$ touch new_file
$ git add new_file
$ git commit
$ git merge v2.6.39 -m "merge message"
# brings up the editor, even though there are no conflicts
--edit
标志。谢谢,它起作用了。 - Shahbaz