我用的是吉特。我做了一个正常的合并,但它一直在问:
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
即使我写了什么,我也不能离开这里。我找不到医生解释这件事。我该怎么办?
发布于 2019-03-24 21:36:27
我知道这可能会很晚,但是我注意到,只有当我提交到一个分支比我要合并的分支更新得多一点时,它才会发生。
结果是,如果我更改一个分支(即,向分支添加更多文件),并尝试将另一个分支合并到其中,Git将请求我为该分支编写一个MERGE_MSG
。
在这个映像中,它显示了我在master
中添加了一个许可文件,在分支npm-init
中添加了一个.gitignore
文件。
因为master
包含一个新文件,npm-init
不知道它,所以Git要求我写一条关于为什么要合并它的消息。
类似地,在合并add-eslint
中的更改之前,我将install-deps
合并为add-dev
。
我知道这可能很难理解(即使对我来说也是如此),但我希望这张图片能把事情弄清楚:)
发布于 2021-11-08 09:23:18
这取决于你的编辑。在vi
和vi
分叉(如vim )中,通过保存(wq
)退出或强制退出而不保存(q!
)不会阻止合并继续进行。为了停止合并以继续,您需要使用错误退出vim。
使用cq!
退出vim将防止合并发生。
发布于 2022-02-17 17:43:14
同样晚于此,但要在@CodeTalker的回答基础上构建:
如果使用的是vi
或vim
,则使用vim状态的:help cquit
文档。
:cq[uit][!] {N} Quit Vim with error code {N}. {N} defaults to one.
Useful when Vim is called from another program:
e.g., a compiler will not compile the same file again,
`git commit` will abort the committing process, `fc`
(built-in for shells like bash and zsh) will not
execute the command, etc.
{N} can also be zero, in which case Vim exits
normally.
WARNING: All changes in files are lost! Also when the
[!] is not used. It works like ":qall!" |:qall|,
except that Vim returns a non-zero exit code.
注意片段中对git commit
的调用
https://unix.stackexchange.com/questions/181280
复制相似问题