Clean Up a Messy Branch
Turn a nine-commit branch full of wip, typo fixes, a debug line and an oops into three clean commits on top of the latest main, one per topic, with the files ending exactly as they were. Then update the pushed branch safely with --force-with-lease. A local self-check verifies the history and writes your submission for instant, rubric-based feedback.
40 min
Est. time
3
Outcomes
5
Rubric criteria
60%
Pass score
What you'll learn
Skills you'll have real reps in after shipping this.
The scenario
Your branch opening-week adds three things for Bean There's opening week: an events page, a discount banner and longer opening hours. It took nine commits to get there: start, wip, a typo fix, a debug line added and later removed, an oops for the banner colour.
You pushed it for review, and since then Priya added a commit to main. Before anyone reads it, make the branch tell the story in three clean steps on top of the latest main.
Your role
You are the author tidying your own branch before review. Your deliverable is opening-week with exactly three commits on top of the latest main, one per topic, each with a clear first line, no trace of the debug line, the same final files as before, pushed with --force-with-lease, and short notes on how you did it and checked it.
Start the task to unlock the full brief
You'll get the step-by-step requirements, setup commands, the 5-criterion grading rubric, tips, and the ability to submit your solution for instant AI grading.
Free to start · submit when you're ready
Learning resources
Practise interactive rebase on a real messy branch
Every developer's branch looks like this before review: wip commits, typo fixes, a debug line added and removed, an oops. This kit gives you exactly that branch, already pushed, with main moved on underneath it. You rebase onto the latest main, reshape nine commits into three clean ones with interactive rebase, keep the final files byte for byte the same, and update the pushed branch safely with --force-with-lease. A local self-check verifies the history and the content and writes your submission only when everything genuinely passes. It is the Level 5 project in Preporato's Git course.