Land the bottom of a stack
The bottom-most PR has approvals and green CI. You want to land it AND keep working on the rest of the stack without manual cleanup.
Starting state
stac-man
main
└─ feat/auth-models #41 open CI ready
└─ feat/auth-handlers #42 open CI ready
└─ feat/auth-docs ← current #43 draft CIYou're sitting on feat/auth-docs. PR #41 is approved and green; the CI chip is green and the ready chip says GitHub considers it mergeable.
Step 1 — confirm the bottom is ready
sm logThe CI badge on the bottom-most row tells you everything you need to know: green CI plus green ready means sm land will proceed without --force. If you see a red CI, an orange conflict, or a draft pill on the bottom-most PR, decide whether you really want to land it before continuing — sm land refuses red CI unless you pass --force, and a conflict chip means the PR will be rejected by GitHub regardless of stac-man's gates.
Step 2 — land
sm landWhat happens, in order:
smwalks toward trunk and finds the bottom-most tracked PR (#41).gh pr checksconfirms CI is green.gh pr merge --squashmerges the PR on GitHub.sm syncruns:- Fetches origin.
- Fast-forwards
main. - Detects
feat/auth-modelsas merged and deletes it locally. - Re-parents
feat/auth-handlersontomain. - Restacks
feat/auth-handlersandfeat/auth-docsonto the newmain. - Calls
gh pr editon#42to retarget its base fromfeat/auth-modelstomain.
Ending state
stac-man
main
└─ feat/auth-handlers #42 open CI ready
└─ feat/auth-docs ← current #43 draft CIfeat/auth-models is gone locally. PR #41 is merged. PR #42's base now points at main so reviewers see only the handler diff. The sm submit that runs as part of sm land's sync also refreshes the stack table on every remaining PR's body so the chain reads one shorter.
Variations
Pick a strategy
Default is --squash. To use a merge commit instead:
sm land --mergeTo use a rebase merge:
sm land --rebaseThe strategy flags are mutually exclusive.
Skip the CI gate
sm land --forceFor when CI is broken on main, not on the PR — or any other case where you've decided red CI is acceptable.
From a branch other than the top
You don't need to be on the top branch. As long as you're somewhere in the stack:
sm checkout feat/auth-handlers
sm land # still finds #41 as the bottomWhat if restack pauses
If retargeting causes a conflict (rare on a healthy stack):
⚠ rebase paused on feat/auth-handlersResolve, git add, then sm continue. The PR has already merged on GitHub at this point — only the local cleanup is paused.
See also
sm land— flag reference.sm sync— what's running under the hood.- Recipes → Recover from a bad rebase — escape hatches if anything goes sideways.
