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.
views:
426answers:
2
+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
2010-03-23 13:58:18
Ah, I suppose I was looking in the wrong place then. Thanks!
Jason Baker
2010-03-23 14:50:57
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
2010-03-23 15:52:02
@conny - I think that's my new favorite quote about git!
Jason Baker
2010-03-24 15:12:21
Does this affect "git pull" and its merge strategy at all?
Thomas G. Mayfield
2010-07-23 19:51:08
@Thomas: Yes; `git pull` is `git fetch` + `git merge`.
BinaryMuse
2010-09-04 22:08:37