Company
Word count
497
Language
English
Contains code?

Text

This page explains how to use Aviator CLI to drive day-to-day development. Before you begin Install Aviator CLI Set up GitHub Personal Access Token Clone your repository locally Initialize your repository with Aviator CLI Run

av init

inside your repository. You need to do this only once per your local clone. Copy

$ av init
Successfully initialized repository for use with av!

Create a topic branch You can create a branch with

av branch BRANCH_NAME

from

main

, or you can also use

av commit --branch-name BRANCH_NAME

to both create a branch and commit your changes to the new branch. Copy

$ git switch main
Already on 'main'
Your branch is up to date with 'origin/main'.
$ echo "Some changes" > testfile
$ av commit -A -m "Add a new file" --branch-name mytopic
[mytopic b420345] Add a new file
 1 file changed, 1 insertion(+)
 create mode 100644 testfile

The topic branch

mytopic

is intended to be merged to

main

later. If you want to use other branch as the merge destination, checkout that branch first. Create a pull-request Create a pull-request with

av pr

. It shows an editor for the pull-request description. Every time you update your local branch, you can run this to update the pull-request. Stack a new topic branch Create a new topic branch on top of the current topic branch with

av branch

. You can see the stack with

av tree

. Add more changes to the branch. Create a second pull-request The second pull-request can be created with

av pr

now. You can see the pull-request URLs with

av tree

. The first pull-request is targeting the

main

branch. And the second pull-request is targeting the first pull-request branch. This will be updated once you merge the first pull-request. Merge and sync the pull-requests Let's merge the first pull-request now. We merge the first pull-request and keep the second pull-request open. After this, we want to make the second one to be rebased on top of the newly updated

main

branch. To do this, we run

av sync

. It fetches the latest

main

from the remote, rebase the second branch on top of it. Choose to push to the remote. Since the first branch is already merged, it asks you if you want to delete the local branch. Choose yes to delete the merged branch. If you run

av tree

, you can see that the second branch now has

main

as the parent. What's next Review the How-to guides for common CLI commands . Learn how to add Aviator CLI commands as a Git subcommand Learn how to adopt a branch created from Git command Previous Stacked PRs CLI Next CLI Installation Last updated 1 year ago Was this helpful?

Analysis

No analysis created yet for this page.