git merge --continue without opening editor

Viewed 2095

I'm working on a script that goes through a number of git operations. There was a git merge failure. On the merge operation, I provided the text message with -m. If, after taking care of the conflicts, I run git merge --continue, I get to see an editor and I'm able to see the lines that I used on the first merge operation so that I can edit them. Now, what I want to do is run git merge --continue but I also want git to allow the message that I used originally for the revision. If I tried with git merge --continue --no-edit it fails miserably:

$ git merge --continue --no-edit
fatal: --continue expects no arguments

usage: git merge [<options>] [<commit>...]
   or: git merge --abort
   or: git merge --continue
.
.
.

I then tried setting the message again:

$ git merge --continue -m "BLAH"
fatal: --continue expects no arguments

usage: git merge [<options>] [<commit>...]
   or: git merge --abort
   or: git merge --continue
.
.
.

So, how can I run git merge --continue skipping the text editor altogether and accepting the original comment?

1 Answers

After a few attempts I was able to do it by setting core.editor to /bin/true:

git -c core.editor=/bin/true merge --continue

Should also work like this:

GIT_EDITOR=/bin/true git merge --continue
Related