All challenges
beginner~8 min4 rounds

History Is Messy, So Force-Push a Clean main?

A bad merge left main tangled with merge and revert commits. A teammate wants to rebase locally and force-push a clean history. Defend what you actually do.

Git

the decision you defend

A bad merge left three ugly merge commits and a reverted-then-unreverted change on main. A teammate wants to rebase main locally to clean it up and git push --force to overwrite the shared history. What do you do, and why?

Sign in to startFree for everyone. Takes a few seconds.

the situation

Someone merged a feature branch into main twice, and main now has a confusing tangle: three merge commits and a change that was reverted and then unreverted. The history reads badly, and a teammate has already produced a locally rebased, linear version that drops all the noise.

context

The repo has four active contributors, all with their own local clones and a few in-flight feature branches based on the current main. The teammate wants to git push --force their rebased history so everyone gets a tidy main, and is pushing back in chat that it is a quick, low-risk cleanup.

How this challenge works

Take a position on the decision above and defend it. A senior-engineer AI will push back over up to 4 rounds. When you are done, you are scored against a verified rubric so you can see exactly what a complete answer covers - these are learning prompts, not gotchas.