Git branches & commits history after merge

你。 提交于 2019-12-02 19:17:28

That is normal Git behaviour. You are doing what is called a "fast-forward" merge, because your branch is strictly ahead of the master branch.

If you really want to preserve branch history (although I'd recommend you don't bother) then you can use git merge --no-ff to force it to create a merge commit even when it can do a fast-forward update.

VonC

You can found addition criticism to the -no-ff option in "Understanding the Git Workflow", mainly because it would break git blame.
More at "fast forward when using pull and no-ff when pull".

As explained in "Why does git use fast-forward merging by default?", unless you are talking about a really long-lived branch, a fast-forward merge is preferable.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!