DEV Community

Discussion on: Regain control of branches with git rebase --onto

Collapse
 
jessekphillips profile image
Jesse Phillips

I'm pretty sure all these use cases are covered by rebase and --interactive. My use of --onto was for unrelated history.

In your first example just pass the first hash to rebase it will select the same second argument because that is the first common ancestor.

Your second can us -i and then drop the commits you don't want, reorder, edit...

Collapse
 
drews256 profile image
Andrew Stuntz

Yeah, you're not wrong. Maybe the examples should be moving to a completely different base?? Seemed like an easy to show how it worked.

Collapse
 
jessekphillips profile image
Jesse Phillips

I do think that is important, but then you'd have to pull in an unrelated but similar repo.