Add Commits in the Stack
You can create stacked PRs with Aviator CLI and send them for review. Your reviewer might request some code changes in one of the PRs in the middle of the stack. This how-to guide explains how to add a change in such cases.
Setup
Let's use Hello-World repository as an example.
Then, create one branch.
This creates 2 branches.
Changing the stack-1
We have two branches that correspond to two PRs; stack-1
and stack-2
. Let's assume that we need to change the stack-1
. By running av stack prev
, you can move back to the previous branch.
You can switch the branch with git switch
or git checkout
as well.
Now make a necessary change.
Currently the commit graph is like this:
We want to make stack-2
to be on top of the new commit 1c. To do this, run av stack sync
.
The file has a rebase conflict. Open myfile
and resolve the conflict, and continue.
Now the stack-2
is rebased on top of the new commit 1c.
Convenient CLI commands
When you need to change the commit in the middle of the stack, you almost always need to run av stack sync
to align the child branches. Aviator CLI has convenient commands, av commit create
and av commit amend
that runs git commit
along with av stack sync
afterwards.
Last updated