git merge 和 git merge --no-ff的區別

git merge –no-ff 能夠保存你以前的分支歷史。可以更好的查看 merge歷史,以及branch 狀態。git

git merge 則不會顯示 feature,只保留單條分支記錄。bash

好比:我當前分支是master, 修復bug的分支是issue-001blog

$ 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).

來一張分解圖示例it

相關文章
相關標籤/搜索