Git Rebase: A Straight Line Instead of a Merge Commit
A feature branch starts clean. It branches off main on Monday, adds tax to the receipt total, and by Wednesday main has moved on: someone rounded the totals to two decimals and added a README. The branch still works, but merging it back adds a merge commit that joins two lines of history, a fork and a join for work that could read as a straight line. Rebasing is the other way to bring a branch up to date. It lifts the branch's commits off the old base and replays them on top of the latest main, so the history reads top to bottom. The question is when that straight line is worth the rewriting it takes. Quick answer Yes, rebase a branch only while it is yours alone, and merge once anyone else depends on it, because rebase lifts the branch's commits off the old base and replays them on top of the latest main. The feature branch added 17 percent tax while main rounded the totals, and after the rebase the tax commit sits on top of both main commits with no fork and no merge commit...