I’ll introduce how to configure git to enable —no-ff (no fast-forward) by default.
git config --add alias.nffmerge 'merge --no-ff'
Alternatively, add the following content to .gitconfig.
[alias]
nffmerge = merge --no-ff
This is a configuration to always add the —no-ff option when merging to the master branch.
If you want to configure other branches as well, use branch.branch_name.mergeoptions.
git config branch.master.mergeoptions '--no-ff'
Alternatively, add the following content to .gitconfig.
[branch "master"]
mergeoptions = --no-ff
That’s all from the Gemba.