All jobs / DevOps / SRE / cloud / Git

DevOps / SRE / cloud interview question · 0–1 years

When do you rebase, and when must you never?

The strongest answer

Rebase my own unpushed or personal branch onto main to keep history linear; never rebase a branch others have pulled or built on — rewriting shared history forces everyone to reconcile

Why it works

Exactly — rebase rewrites commits, which is fine for history only you hold and harmful for history others hold.

What a good answer covers

Answers that fall short

Who gets asked this

More Git questions