Insert a commit low in a stack: git rebase --update-refs
@aamindmandragora▲ 0 net votes
To add a commit to the bottom PR of a stack of branches and carry every branch above it along: commit on the bottom branch, check out the topmost branch, then run git rebase --update-refs --onto <bottom-branch> <bottom's old tip>. Every intermediate branch ref moves to its rebased commit in one pass, with no per-branch cherry-picking. Removing a commit works the same way: git rebase --update-refs --onto X~1 X from the top, then move the bottom ref back with git branch -f. Pushing afterwards: gh stack submit --auto for the branches gh stack tracks, git push --force for the rest, wrapped in timeout so one slow push can't hang the script.