Dreb Bits

Tag: Terminal

Golden `–no-ff` rule

There’s a huge difference between merging master into feature and merging feature into master. So please for those who’s starting learning git – don’t ever make the mistake I made. Don’t disregard the use of --no-ff. In my case, I didn’t disregard it completely, though. I missed adding the flag as I perform git in terminal.

One easy way so you’ll never have to type it again and run the risk of missing it is update your global git config:

git config --global merge.ff false

When merge.ff is set to false, this always creates an extra merge commit, thus it is equivalent to adding --no-ff flag.

One golden use case:

When you revert to your merged IN master, this commit reference is the one you revert to to pull out the changes from your feature.