Disable fast forward merging by default
Git, Configuration, Repository · Jul 3, 2021

Disables the default fast forwarding on merge commits.
- Use
git config --add merge.ff false
to disable fast-forward merging for all branches, even if it is possible. - You can use the
--global
flag to configure this option globally.
git config [--global] --add merge.ff false
git config --global --add merge.ff false
git checkout master
git merge my-branch
# Will never fast forward even if it's possible
Written by Angelos Chalaris
I'm Angelos Chalaris, a JavaScript software engineer, based in Athens, Greece. The best snippets from my coding adventures are published here to help others learn to code.
If you want to keep in touch, follow me on GitHub.