sm parent
Show or change the parent of a branch.
Synopsis
sm parent [branch] [--set <new-parent>]If no branch is given, operates on the current branch.
Flags
| Flag | Description |
|---|---|
--set <branch> | Reassign parent to the given branch and restack. |
Examples
Print the current branch's parent:
bash
sm parent
# feat/auth-modelsPrint another branch's parent:
bash
sm parent feat/auth-handlers
# feat/auth-modelsReassign and restack:
bash
sm parent --set feat/db-schemaWhat --set does
- Updates
branch.<n>.stac-man-parentto the new value. - Runs the restack engine to rebase the branch (and only this branch) onto the new parent's tip.
- On conflict, pauses with a
PausedError— same protocol assm restack.
parent vs. move
sm parent --set | sm move --onto | |
|---|---|---|
| Reparents a single branch? | Yes | Yes |
| Reparents the subtree (descendants too)? | No — only the named branch is restacked | Yes — descendants ride along |
Use sm parent --set when only one branch is moving; use sm move when the whole subtree should follow.
See also
sm move— subtree reparent.sm children— list children of a branch.
