Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I set merge "No Fast Forward" as the default in TortoiseGit?

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?

like image 638
Len Avatar asked May 24 '17 03:05

Len


People also ask

Does git merge fast forward by default?

Fast-forward mode is the default in Git, however GitHub will essentially override this by default and create a merge commit instead.

What happened fast forward merge?

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.

What is the difference between fast forward and 3 way merge?

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.


1 Answers

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.

like image 98
Len Avatar answered Oct 30 '22 13:10

Len