move
The move command (alias reparent) reparents a branch within the stack. It updates the panqake metadata, optionally updates the open PR's base on GitHub, then rebases the branch and its descendants onto the new parent so the entire subtree comes along.
This is useful when you realize a branch should sit on top of a different prerequisite — for example, sliding a branch from main onto a feature that turned out to be a dependency, or moving a subtree to a sibling stack.
Usage
pq move [BRANCH_NAME] --to <NEW_PARENT>Arguments
| Argument | Description |
|---|---|
BRANCH_NAME | Branch to move (default: current branch) |
Options
| Option | Description |
|---|---|
--to | New parent branch (if not provided, will prompt) |
--continue | Resume a previously conflicted move after running git rebase --continue |
--json | Output machine-readable JSON |
Examples
Move the current branch under a new parent
pq move --to feature-xMove a specific branch
pq move feature-b --to mainMove a subtree
If the branch you move has descendants, they come along automatically — each descendant is rebased onto its (rewritten) parent in turn.
Behavior
- Updates the parent reference in the panqake stack.
- If the branch has an open PR, updates the PR base on GitHub (requires
ghCLI; warns if unavailable). - Runs
git rebase --onto <new-parent> <old-parent> <branch>, taking only the commits unique to the branch. - Recursively rebases each descendant onto its (now-rewritten) parent.
- Returns you to the branch you started on.
After Moving
The rebased branches have new commit SHAs, so the remotes are stale. The command prints an explicit pq submit <branch> line for each rebased branch — run them to force-push.
Handling Conflicts
If a rebase conflict occurs, git is left mid-rebase so you can resolve it:
- Resolve the conflicts in your editor.
- Run
git rebase --continue. - Run
pq move --continueto finish rebasing any remaining descendants of the moved subtree.
The stack metadata and the moved branch's pre-rebase SHA are persisted before the rebase begins. pq move --continue uses the persisted SHA as the --onto upstream when rebasing each descendant, so the recovery path preserves the same git rebase --onto NEW_PARENT OLD_SHA <descendant> semantics as the success path — descendants never replay commits from the old parent's history.
INFO
Panqake prevents cycles: you cannot move a branch onto one of its own descendants.