# Branch Management

mirrord provides CLI commands to inspect and manage database branches.

1. #### View Branch Status using:

```bash
  mirrord db-branches [(-n|--namespace) namespace] [-A | --all-namespaces] status [name...]
```

* Shows the status of running database branches.
* If specific branch names are provided, mirrord shows their statuses.
* If no names are given, all active branches in the selected namespace (or all namespaces, if --all-namespaces is used) are listed.
* If no branches are active, mirrord returns:`No active DB branch found`

2. #### Destroy Branches using:

```bash
mirrord db-branches [(-n|--namespace) namespace] [-A | --all-namespaces] destroy (--all | name...)
```

* Destroys one or more running database branches.
* Use `--all` to destroy every active branch.
* Use one or more branch names to target specific branches.
* mirrord uses the default namespace, or the namespace specified with `--namespace`.
* To destroy branches across all namespaces, use `--all-namespaces`.
* If no active branches are found, mirrord returns: `Error: No active DB branch found`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://metalbear.com/mirrord/docs/sharing-the-cluster/db-branching/db-branch-management.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
