Repository navigation
Conversation
Once a branch was in a stack there was no way to take it back out short of gh stack modify, and dropping one from the middle meant rebasing everything above it by hand so its commits went away. That's the opposite of init, and it should be just as cheap. Untrack takes a branch and everything above it out of its stack. gh stack keeps a stack as a single line so it can't have a gap, and the branches themselves are left exactly as they are (no ref moves, nothing is checked out); a stack left empty just goes away. With only, just that branch comes out and the ones above close the gap: they go through the reshape engine onto its parent, so the base fixing drops its commits, a conflict stops for continue or abort, and abort puts everything back. The untracked branch isn't in any stack after that, so the abort couldn't find its entry in the graph like it does for a moved branch. The snapshot now remembers which branches were untracked (and their heads), and restoring puts those back too. A stack GitHub already knows is queued to be dissolved like any other reshape; no PR is closed, since the branches still exist and can be tracked again.
Dropping a branch from a stack was the last thing the README still sent you to gh stack modify for. So git stack untrack (and git untrack) now does it: the current branch, or the one you name, comes out along with everything above it, or with --only just that branch, and the ones above are restacked onto its parent. It prints what was untracked, what was restacked and the git stack init that tracks them again. Agents get the same thing as stack_untrack, with branch and only. The README, the MCP docs, the agent skill and the architecture notes cover it, and "What it doesn't do" no longer points at gh stack modify.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Once a branch was in a stack there was no way to take it back out short of
gh stack modify. It's the opposite ofgit stack init, so it should be just as cheap.git stack untrack [branch](andgit untrack) stops tracking a branch and everything above it. A stack is a single line so it can't have a gap, and the branches themselves aren't touched at all: no commits, refs or checkouts change. With--onlyjust that branch comes out, and the ones above close the gap by being restacked onto its parent (dropping its commits). A conflict there stops like any restack, and abort puts everything back, the untracked branch included. PRs stay open either way, and a stack GitHub already knows is regrouped at the next submit. Agents getstack_untrack.While doing this I noticed pop had already added a way for abort to put back a branch that's no longer in any stack, which is exactly what untrack needs. So untrack uses that rather than a second copy of the same thing.