git merge 和 git merge --no-ff的区别

git merge –no-ff 可以保存你之前的分支历史。能够更好的查看 merge历史,以及branch 状态。

git merge 则不会显示 feature,只保留单条分支记录。

比如:我当前分支是master, 修复bug的分支是issue-001

$ git checkout master
Switched to branch 'master'
Your branch is ahead of 'origin/master' by 2 commits.
$ git merge --no-ff -m "merged bug fix 001" issue-001 //合并issue-001分支
Merge made by the 'recursive' strategy.
 readme.txt |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
$ git branch -d issue-001
Deleted branch issue-101 (was cc17032).

来一张分解图示例

 

posted @ 2017-12-13 19:07  周伯通之草堂  阅读(33603)  评论(0编辑  收藏  举报