views:

426

answers:

2

I can't really ever think of a time when I would use git merge rather than git rebase and not want to have a commit show up. Is there any way to configure git to have fast forwarding off by default? The fact that there's an --ff option would seem to imply that there's a way, but I can't seem to find it in the documentation.

+2  A: 

Try the --no-ff option for git merge.

Evan Shaw
+12  A: 

Yes, there is --no-ff. You can configure merge options per branch, e.g.

git config branch.master.mergeoptions  "--no-ff"

adds the following to your $(REPO)/.git/config file:

[branch "master"]
    mergeoptions = --no-ff
conny
Ah, I suppose I was looking in the wrong place then. Thanks!
Jason Baker
Learning git is a bit like mountain climbing; but instead of starting with small cliffs and progressing to tougher ones, git makes you climb the same mountain again and again, only to fall at different heights each time, every time just as surprised that the lifeline wasn't attached.
conny
@conny - I think that's my new favorite quote about git!
Jason Baker
Does this affect "git pull" and its merge strategy at all?
Thomas G. Mayfield
@Thomas: Yes; `git pull` is `git fetch` + `git merge`.
BinaryMuse