`gh stack rebase -i` - allow interactive rebasing
Support -i for rebasing stacks.
I ❤️ rebasing, and doing no-edit amends. When I do that in a branch low in the stack, the higher layers end up with "duplicate-ish" commits that conflict. The solution during a normal rebase is to drop that new duplicate. Here's an example
Initial State
branch-a
main -> commitA (111aaa)
branch-b
main -> commitA (111aaa) -> commitB (222bbb)
Change in branch-a and git commit --amend'd
if I go to branch-a and make a change using git commit --amend I'll end up with this:
branch-a
main -> commitA (112aaa)
branch-b
main -> commitA (111aaa) -> commitB (222bbb)
Finally, rebasing branch-b
Then when branch-b gets rebased, it looks like this:
main -> commitA (112aaa) -> commitA (111aaa) -> commitB (222bbb)
Again, the solution is simply to drop commitA (111aaa), as that's the old one.
But I can't do that with gh stack rebase.
Another 0.0.7 reproduction:
- Create
main <- A <- B. - Rewrite A, leaving B based on the old A SHA.
- From B, run
gh stack rebase --no-trunk.
The rebase starts replaying the old A commit onto rewritten A and conflicts before reaching B. Expected: replay only B's unique commits.
Congratulations on officially becoming public preview! 🥳
I re-tested on July 30, 2026 with gh-stack v0.1.0 and can verify that the amended-parent correctness case is fixed! 🎉
Exact reproduction: main <- A <- B, amend A, then run gh stack rebase --no-trunk from B. The result was main -> rewritten A -> B. The old A was not an ancestor, only two stack commits remained, and no conflict occurred. Hooray!
The interactive-rebase feature request remains separate; however, the duplicate-parent replay described above is fixed. 🙏
This issue should now be closed.