sm move
Reparent a branch (and its subtree) onto a new base. Descendants ride along.
Synopsis
sm move [branch] --onto <new-parent>If no branch is given, operates on the current branch. --onto is required.
Flags
| Flag | Description |
|---|---|
--onto <branch> | New parent branch. Required. Tab-completes to tracked branches + trunk. |
Examples
Move the current branch and its subtree onto trunk:
bash
sm move --onto mainMove a specific branch onto a sibling:
bash
sm move feat/web-form --onto feat/api-v2What it does
- Reassigns
branch.<n>.stac-man-parentto--onto. - Runs the restack engine over the named branch AND every descendant. Each branch is rebased onto its (possibly new) parent's tip.
- On conflict, pauses with a
PausedError— same protocol assm restack.
move vs. parent --set
sm move --onto | sm parent --set | |
|---|---|---|
| Reparents a single branch? | Yes | Yes |
| Reparents descendants too? | Yes | No |
Use sm move when you mean "move this subtree somewhere else"; use sm parent --set for fine-grained surgery.
See also
sm parent— single-branch reparent.sm split— when "move" turns out to mean "this should be several branches."- Recipes → Recover from a bad rebase.
