开发者

Git creates a merge commit although it performs a fast-forward merge

I'm merging a hotfix branch into master. When I do a simple git merge hotfix-2.09 the merge fast-forwards but I'm ge开发者_如何转开发tting a 'merge branch "hotfix-2.09"' commit in the log. hotfixes 01 - 08 did not do this. Am I doing something wrong with this merge or did the state of my master change some how?

edit I guess this is not really a fast forward but acting like it.

[webapps@Staging www]$ git merge hotfix-2.09
Auto-merging includes/processOrderFunctions.php
Merge made by recursive.
 includes/processOrderFunctions.php |   38 +++++++++++++++++++++++++++++++----
 processorderPL.php                 |   29 ++++++++++++++++++---------
 2 files changed, 52 insertions(+), 15 deletions(-)


Are you sure it fast-forwarded? You wouldn't get a merge commit if it did.

By the sounds of it, you're merging multiple hot-fixes into a branch. I assume these hotfix branches were created from the same point in time (master) and are not cumulative? (i.e. they all branched from master, not hotfix-2 from hotfix-1 etc...).

Then the first branch merged would fast-forward, because the parent-ref of the commits would match up to master. When you merged your second branch, its parent-ref would be pointing to the original HEAD of master and not the new one. This means it can't be fast-forwarded, because it's not a linear path, and this would require a merge to "flatten" the trees.


Did you rebase hotfix-2.09 to master before doing the merge?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜