Skip to content

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

FlagDescription
--set <branch>Reassign parent to the given branch and restack.

Examples

Print the current branch's parent:

bash
sm parent
# feat/auth-models

Print another branch's parent:

bash
sm parent feat/auth-handlers
# feat/auth-models

Reassign and restack:

bash
sm parent --set feat/db-schema

What --set does

  1. Updates branch.<n>.stac-man-parent to the new value.
  2. Runs the restack engine to rebase the branch (and only this branch) onto the new parent's tip.
  3. On conflict, pauses with a PausedError — same protocol as sm restack.

parent vs. move

sm parent --setsm move --onto
Reparents a single branch?YesYes
Reparents the subtree (descendants too)?No — only the named branch is restackedYes — descendants ride along

Use sm parent --set when only one branch is moving; use sm move when the whole subtree should follow.

See also

Released under a license that is currently TBD.