Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git merge --continue without opening editor

Tags:

git

merge

editor

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?

like image 831
eftshift0 Avatar asked Feb 22 '26 20:02

eftshift0


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
like image 76
eftshift0 Avatar answered Feb 24 '26 09:02

eftshift0



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!