--no-ff refers to forcibly turning off the fast-forward method.
The fast-forward method means that when conditions permit, git directly points the HEAD pointer to the head of the merged branch to complete the merge. It belongs to the "fast forward mode", but if you delete the branch in this case, the branch information will be lost. Because no commit is created during this process
git merge --squash 是用来把一些不必要commit进行压缩,比如说,你的feature在开发的时候写的commit很乱,那么我们合并的时候不希望把这些历史commit带过来,于是使用--squashMerge. At this time, the file is the same as after the merge, but HEAD will not be moved or submitted. An additional commit is needed to "wrap it up" and then complete the final merge.
Summary: --no-ff:不使用fast-forward方式合并,保留分支的commit历史 --squash: Do not use the fast-forward method to merge, retain the commit history of the branch
--squash: Use the squash method to merge, compress multiple branch commit histories into one
Create a merge commit even when the merge resolves as a fast-forward. This is the default behaviour when merging an annotated (and possibly signed) tag.
--no-ff
refers to forcibly turning off the fast-forward method.The fast-forward method means that when conditions permit, git directly points the HEAD pointer to the head of the merged branch to complete the merge. It belongs to the "fast forward mode", but if you delete the branch in this case, the branch information will be lost. Because no commit is created during this process
git merge --squash
是用来把一些不必要commit进行压缩,比如说,你的feature在开发的时候写的commit很乱,那么我们合并的时候不希望把这些历史commit带过来,于是使用--squash
Merge. At this time, the file is the same as after the merge, but HEAD will not be moved or submitted. An additional commit is needed to "wrap it up" and then complete the final merge.Summary:
--no-ff
:不使用fast-forward方式合并,保留分支的commit历史--squash
: Do not use the fast-forward method to merge, retain the commit history of the branch--squash
: Use the squash method to merge, compress multiple branch commit histories into onehttp://git-scm.com/docs/git-merge