Rebase vs Merge, Without the Holy War

Everyone has opinions about git rebase vs git merge. Here’s a rule of thumb that has served me well.

The short version

# clean up your local branch before opening an MR
git rebase main

# integrate a reviewed feature branch
git merge --no-ff feature/login

The golden rule: don’t rebase commits that other people already pulled. Rewriting shared history is how you ruin a Friday afternoon.