In order to make it easy to see when feature branches are merged to master, one can use Git's --no-ff
option when merging their feature branch into master.
One way to accomplish this without needing to type --no-ff
is to disable fast-forward merges into master entirely:
git config branch.master.mergeoptions --no-ff
However, this is clumsy since it also prevents fast-forward merges when simply merging upstream changes in master to a local copy of master (merge commits are created for normal git pull
s.)
Is there some way to configure Git to prevent fast-forward merges into master only when merging feature branches into master, so that fast-forwards are allowed when doing git pull
s from master, but merge commits are always created when merging feature branches? Or is explicitly using --no-ff
the only way to accomplish this?