5

The "Vim opens asking for commit message after implicit non-conflicting merge" seems to be a relatively common issue, with what seems to be a relatively simple answer: git config --global core.mergeoptions --no-edit.

Unfortunately this doesn't seem to work for me or at least 8 of the other 15 people in my class, and our instructor is a bit baffled as well (though to be fair he hasn't had the time to look into it beyond a quick google search or two). It isn't that big of an issue, as you can escape out easily enough with :q, but it is something we'd like to know the answer to, and my google searches return Stack Overflow questions with --no-edit as the solution (either via core or every time a pull is done).

My .gitconfig (minus personal info):

[mergetool "kdiff3"]
        path = "/c/Program Files/KDiff3/kdiff3.exe"
[merge]
        tool = kdiff3
[core]
        mergeoptions = --no-edit
[mergetool]
        keepBackup = false

And yet:

image.

Does anyone know why the fix isn't working (ie: "Ya dun goofed in spelling 'options'"), or if there is a better/more reliable way to fix this?

Community
  • 1
  • 1
Matoyak
  • 53
  • 1
  • 4
  • I think you are supposed to have a branch instead of core so `s/core/branch "master"/` – FDinoff Apr 22 '16 at 02:44
  • `core.mergeoptions` does not do anything (nothing checks for it so setting it has no effect). See the comments on that answer, and the other answers in the same question. – torek Apr 22 '16 at 02:59
  • @torek The initial answer on that one I linked had no comments other than "this doesn't seem to work", and the other answers implied that both solutions (The export autoedit=no one and git merge --no-edit) were equal. Your comment explaining that core.mergeoptions doesn't exist wasn't there at the time, and cmbuckly's I just outright didn't see. Sorry about that. Thanks for the explanation though :) – Matoyak Apr 22 '16 at 06:29

2 Answers2

13

You need to add add export GIT_MERGE_AUTOEDIT=no in the .bash_profile and open a new bash.

You can do that with the next bash command:

echo 'export GIT_MERGE_AUTOEDIT=no' >> $HOME/.bash_profile && . $HOME/.bash_profile

I hope that helps :D

Fabricio
  • 3,248
  • 2
  • 16
  • 22
  • Thank you for the handy bash command. :) The answers I saw on the other answer I misunderstood (likely due to lack of sleep, honestly) as implying the two things were basically doing the same thing. I'll try it out and if it works mark this as the accepted answer for the helpful bash command :) (It'll probably be tomorrow that I am able to really check this out, as it's nearly 2am where I am). – Matoyak Apr 22 '16 at 06:35
2

Fix this by adding export GIT_MERGE_AUTOEDIT=no to the .bash_profile file.

grepsedawk
  • 3,324
  • 2
  • 26
  • 49