7

I want "git merge" to not commit by default (i.e., I want the "--no-commit" behaviour by default), regardless of the destination branch.

I know of "git config branch.master.mergeoptions" for a particular branch, and I know of "git config merge.noff no" for disabling fast-forward on all branches by default.

None of the following experiments work for me. Should they?

  • git config branch.mergeoptions --no-commit
  • git config branch.*.mergeoptions --no-commit
  • git config merge.commit no

Can't seem to find the answer via Google searches.

beau
  • 113
  • 6
  • I'm not sure `git config` allows for wildcards like `branch.*.mergeoptions` - you may need to specify it branch-by-branch, which is admittedly a pain. Did you try the `no-commit` without the leading hyphens (e.g. `git config branch.mybranch.mergeoptions no-commit`)? Not sure if that's correct either... – twalberg Jul 09 '14 at 20:34
  • 2
    You could workaround this by overriding `merge` with an alias like `merge=merge --no-commit`, not sure if this affects the commands done by a GUI though. – Sascha Wolf Jul 10 '14 at 05:48

1 Answers1

2

As I answered in the linked Question:

git config --global merge.commit no

I think the part which is of interest (you had tried almost the same) is the 'global' part.

Alim Özdemir
  • 1,944
  • 17
  • 28