I'm trying to configure git to always accept the default merge message when merging (with option --no-edit). I found this answer (Git merge doesn't use default merge message, opens editor with default message) but it doesn't work for me, and it is not listed in the manual (git-config).
The following configuration (with an actual branch name rather than "*") does work for a single branch, but I need the configuration on all branches, so I tried this, to no avail.
[branch "*"]
mergeoptions = --no-edit
Is there any global configuration to do this ?
EDIT
While searching I found the branch "*" configuration was proposed a while back as a patch, but never implemented ([PATCH] Add default merge options for all branches).
No, merging does only affect one branch.
With --no-commit perform the merge and stop just before creating a merge commit, to give the user a chance to inspect and further tweak the merge result before committing. Note that fast-forward updates do not create a merge commit and therefore there is no way to stop those merges with --no-commit.
Setting this to true means that that particular branch will always pull from its upstream via rebasing, unless git pull --no-rebase is used explicitly.
But, instead of using a merge commit, rebasing re-writes the project history by creating brand new commits for each commit in the original branch. The major benefit of rebasing is that you get a much cleaner project history. First, it eliminates the unnecessary merge commits required by git merge .
Overriding the merge
command with an alias that appends --no-edit
seems to work:
[alias]
merge = merge --no-edit
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With