Interview Prep/Git & GitHub/Branching and workflow design

How do you deal with a team that keeps force-pushing to shared branches?

IntermediateProductionBranching and workflow design
Answer

Fix the system, not the person: protect shared branches so force-push is blocked, give each developer private feature branches (rebase freely there) and teach --force-with-lease. Add a lightweight rule that a branch with more than one contributor is never rebased without agreement.

All Git & GitHub questions Roadmap: Git & GitHub

More on Branching and workflow design