Learn how to edit the branch order in a stack using Graphite CLI commands.
gt move
rebases the current branch and all of its recursive children (anything upstack of the current branch) onto a branch of your choice.
gt move --onto <BRANCH_NAME>
if you already know the branch name of your current branch’s new parent. After successfully running gt move --onto
with main
, you should see the following output (given that there are no merge conflicts)
gt reorder
. gt reorder
opens an editor that allows you to manually copy and paste branch names into different orders. The editor will only show the branch you currently have checked out, as well as anything downstack (ancestors) of it.
second_branch
in the above example yields the following output:
--insert
branch when invoking the gt create
command. See the following example:
gt move
, gt reorder
, and gt create --insert
perform restacks just like gt modify
—and there is a chance you can run into merge conflicts when invoking them. If you do, you can follow the same flow as encountering merge conflicts after creating/amending commits to branches mid-stack.