Reference
mg reparent
Change a branch’s parent
Name
mg reparent
— Reassign the parent of a branch in the stacked hierarchy.
Synopsis
Description
- If
<branch_name>
is omitted, the current branch’s parent is changed. - Useful when a branch was based off the wrong trunk or feature.
Options / Flags
--parent <parent_branch>
: The new parent branch.
Examples
- Re-stacking might involve rebasing. If conflicts occur, you’ll need to resolve them manually.
- Use carefully if your branch was already pushed and is under active review.
Was this page helpful?