Selective Rebase
Task
While on bugFix, move the last four commits of this branch (C2-C5) directly onto the tip of main.
Requirements
- Select a range that starts after
HEAD~4. - Use
mainas the new base. - Apply a selective rebase with
--onto.
Expected result
The bugFix branch must end with a rewritten chain of four commits on top of main. HEAD must stay on bugFix.
What you will learn
After completing the task, you will be able to:
- specify the old and the new base for a rebase;
- move only a selected section of history;
- use
--ontofor complex graph restructuring.
Goal
local