> For the complete documentation index, see [llms.txt](https://metalbear.com/mirrord/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://metalbear.com/mirrord/docs/sharing-the-cluster/db-branching/more/management.md). # Branch Management See the status of the mirrord DB branches in your cluster, and remove the ones you no longer need. mirrord provides CLI commands to inspect and manage database branches: | Command | Purpose | | ------------------------------------------------ | ------------------------------------------------ | | `mirrord db-branches status [name...]` | Show the status of running database branches | | `mirrord db-branches destroy (--all \| name...)` | Destroy one or more running database branches | | `mirrord db-branches connections` | List the currently active DB branch portforwards | All commands accept `(-n\|--namespace) namespace` to select a namespace and `-A\|--all-namespaces` to operate across all namespaces. ## View Branch Status ```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` Example output: | Name | Pod Name | DB Type | Phase | TTL (sec) | Database | Users | Expires At | | ------------------------------------ | ---------------------------------------- | ---------- | ----- | --------- | ---------------------- | --------------- | ----------------------------- | | `mirrord-pg-branch-070081bc40967ac9` | `mirrord-postgresql-branch-db-pod-686qf` | PostgreSQL | Ready | 600 | `my_database_name_etc` | `minikube-user` | `2026-07-06T04:36:59.683405Z` | ## Destroy Branches ```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` ## List Branch Portforwards ```bash mirrord db-branches connections ``` * Lists the currently active DB branch portforwards, which are set up automatically while a session is active. See [Portforwards](/mirrord/docs/sharing-the-cluster/db-branching.md#portforwards). Example output: | DB ID | Address | Key | Session ID | | -------------------- | ----------------------------------------------------------------------------------------- | ------- | ------------------ | | `pg-dev-random-id10` | `postgresql://postgres:postgres-branch-pod-root-password@[::]:53778/my_database_name_etc` | `40c85` | `5E68BB2A295FDC5E` | When no session is active: ``` No active portforward sessions. ``` --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters: ``` GET https://metalbear.com/mirrord/docs/sharing-the-cluster/db-branching/more/management.md?ask=&goal= ``` `ask` is the immediate question: it should be specific, self-contained, and written in natural language. `goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case. 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.