search

Home  >  Q&A  >  body text

git merge --no-ff是什么意思

--no-ff是什么意思??
和 git merge --squash 有什么区别???

phpcn_u1582phpcn_u15822773 days ago990

reply all(3)I'll reply

  • 巴扎黑

    巴扎黑2017-04-28 09:07:23

    --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

    🎜

    reply
    0
  • 过去多啦不再A梦

    过去多啦不再A梦2017-04-28 09:07:23

    reply
    0
  • ringa_lee

    ringa_lee2017-04-28 09:07:23

    http://git-scm.com/docs/git-merge

    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.

    reply
    0
  • Cancelreply