我正在编写一个经过许多 git 操作的脚本。有一个git merge失败。在合并操作中,我提供了带有-m. 如果在处理冲突后运行git merge --continue,我会看到一个编辑器,并且我能够看到我在第一次合并操作中使用的行,以便我可以编辑它们。现在,我想做的是运行,git merge --continue但我也希望 git 允许我最初用于修订的消息。如果我尝试使用git merge --continue --no-edit它惨遭失败:
$ git merge --continue --no-edit
fatal: --continue expects no arguments
usage: git merge [<options>] [<commit>...]
or: git merge --abort
or: git merge --continue
.
.
.
Run Code Online (Sandbox Code Playgroud)
然后我再次尝试设置消息:
$ git merge --continue -m "BLAH"
fatal: --continue expects no arguments
usage: git merge [<options>] [<commit>...]
or: git merge --abort
or: git merge --continue
.
.
.
Run Code Online (Sandbox Code Playgroud)
那么,我如何才能git merge --continue完全跳过文本编辑器并接受原始评论?
经过几次尝试,我能够通过设置core.editor来做到这一点/bin/true:
git -c core.editor=/bin/true merge --continue
Run Code Online (Sandbox Code Playgroud)
也应该像这样工作:
GIT_EDITOR=/bin/true git merge --continue
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1165 次 |
| 最近记录: |