Sometimes while merging branches I come across this --no-ff flag. I read some resources online, but unfortunately couldn't understand it properly. Can someone please explain it to me? I really appreciate all your help.
From --help:
--ff When the merge resolves as a fast-forward, only update the branch pointer, without creating a merge commit. This is the default behavior.
--no-ff 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.
If you merge fast-forward the existing "source"-commits are "placed" on top of the "target"-commits.
With --no-ff a (single) new commit is created and "placed above" the last "target"-commit.
PS: A good git-resource to read is the GitBook. (in different languages available)
Sai Kishore Komanduri
Engineering an eGovernance Product | Hashnode Alumnus | I love pixel art
One of the two main ways of integrating changes from one branch into another, in git, is to do a
merge. The flag--no-ffis used in the context of performing agit mergeoperation; it stands for 'no fast forward'.To understand this flag properly, the notion of merging a branch - doing it in a fast-forward way, and otherwise - should become clear. This article: ariya.ofilabs.com/2013/09/fast-forward-git-merge.… ... explains the difference in a succinct way.
Bonus: The other main way is to do a
rebaseCheck this out: git-scm.com/book/en/v2/Git-Branching-Rebasing