I’m using git 2.39.2 on macOS 10.15.7
I ran the following:
git config --global merge.commit no
git config --global merge.ff no
So my ~/.gitconfig now looks like this:
# This is Git's per-user configuration file.
[user]
name = myname
email = myemail@example.com
[http]
postBuffer = 1048576000
[merge]
commit = no
ff = no
But still, when I run the following:
git switch main
git merge feature
It automatically brings me into a commit message editor.
Running git merge --no-commit feature still works as expected and gives me:
Automatic merge went well; stopped before committing as requested
But why doesn’t it do that without --no-commit when I have commit = no in my ~/.gitconfig settings?
>Solution :
But why doesn’t it do that without –no-commit when I have commit = no in my ~/.gitconfig settings?
Because there is no merge.commit config variable. You can set any key you want in your config, but it won’t do anything unless some piece of code recognizes it. There’s no mention of merge.commit anywhere in the git source or documentation.