I don't use fast-forward merges in my workflow. I note that in git itself, one can include this in their .gitconfig to get fast forwarding off by default:
[merge]
ff = false
TortoiseGit doesn't seem to do anything with this, though. When I go to merge, the "No Fast Forward" checkbox is still unticked. When I carry out the merge, I see it still invokes the command git.exe merge Branch_test
, without the --no-ff
switch.
How do I get it to default off?
Fast-forward mode is the default in Git, however GitHub will essentially override this by default and create a merge commit instead.
Fast-forward merges literally move your main branch's tip forward to the end of your feature branch. This keeps all commits created in your feature branch sequential while integrating it neatly back into your main branch.
It is called so because, in the 3-way merge, Git uses three commits to generate the merge commit; two branch tips and their common ancestor. Typically, the fast forward merge is used by developers for small features or bug fixes while the 3-way merge is reserved for integrating longer-running features.
Aha!
Setting
[merge]
ff = false
in the config file does prevent fast forwarding when merging using TortoiseGit, because that changes the behaviour of git.exe
itself.
With that option added, the "No Fast Forward" checkbox on the merge dialogue will not do anything! Instead, all merges will be "no fast forward" merges.
It's a bit clumsy, because it means I don't have the option in the TortoiseGit dialogue to override that default (ie, to use the --ff
switch on the merge command). Still, it does approximately what I need.
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