Home / Companies / Aviator / Documentation / Page Details

How to Adopt a Branch in CLI | Aviator Documentation

Documentation page from Aviator

Page Details
Company
Word Count
329
Language
English
Contains Code
Unknown
Date Parsed
2025-12-11
Version History 1 version
2025-07-07 Current 2025-07-07 (latest)
Text

Aviator CLI needs to maintain the metadata for branches so that it can remember the parent-child relationships among them. If you create branches with

av branch

, the metadata is created upon branch creation. You can attach the metadata for branches that are created with

git branch

. Create a repository We will use an example repository from https://github.com/octocat/hello-world . Clone it and initialize the Aviator CLI. Copy

$ git clone https://github.com/octocat/hello-world
Cloning into 'hello-world'...
remote: Enumerating objects: 13, done.
remote: Total 13 (delta 0), reused 0 (delta 0), pack-reused 13
Receiving objects: 100% (13/13), done.
$ cd hello-world
$ av init
Successfully initialized repository for use with av!

Creating a branch outside of av Let's say instead of using

av branch

, we used a normal Git command to create a branch and a commit. Copy

$ git switch --create mytopic
Switched to a new branch 'mytopic'
$ git commit --allow-empty --message="New commit"
[mytopic d384683] New commit

Now we can see, the newly created branch

mytopic

is not tracked in

av tree

, but it's shown in

git branch

. Adopting a branch with av adopt By running

av adopt

specifying the parent branch (in this case

master

) adds metadata for the current branch

mytopic

. Now, if you run

av tree

, you can see that

mytopic

is correctly recognized as a child of

master

. Adopting an existing PR If you have also created a PR without using

av

, you can also synchronize your local

av tree

to adopt that PR. To do so, first adopt the branch as described above and then run

av sync

. Previous How to Rename a Branch in CLI Next Orphan a Branch with Aviator CLI Last updated 1 month ago Was this helpful?

Analysis

No analysis available for this page.

Product Messaging

No product messaging analysis available for this page.

Competitive Analysis

No competitive analysis available for this page.