> For the complete documentation index, see [llms.txt](https://docs.ox.security/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ox.security/scan-and-analyze-with-ox/scanning/multi-branch-support.md).

# Scanning Multiple Branches

You can streamline your security management across multiple branches while maintaining comprehensive visibility into potential vulnerabilities. Multi-Branch Scanning allows OX to scan multiple branches within a repository, extending your security coverage beyond the default branch.

This capability enables you to scan branches that represent:

* Various versions of your software
* Various stages of development, such as development, staging, and production

### How Multi-Branch Scanning Works

When you enable Multi-Branch Scanning, you can scan up to five branches in a repository. If the default branch scanning option is enabled, the default branch counts toward this limit.

Each scanned branch is treated as a separate application, with its own findings, trends, and scan history.

Enabling the capability can change how the system operates, and it may affect existing data or issue handling. You can expect potential delays or changes in the data and issue resolution process, as the scan process becomes more complex.

You can define which branches to scan in the following ways:

* [for all repos](#securing-branches-in-all-repos)
* [for an individual repo](#securing-branches-of-an-individual-repo)

The following table summarizes how the branch scanning settings work together.

| Multi-Branch Scanning | Scan default branch | Result                                                                         |
| --------------------- | ------------------- | ------------------------------------------------------------------------------ |
| Disabled              | Enabled             | Only the default branch is scanned.                                            |
| Enabled               | Enabled             | OX scans the default branch and up to four additional selected branches.       |
| Enabled               | Disabled            | OX scans only the selected non-default branches, up to five branches in total. |

## Enabling the capability and securing branches in all repos

Initially, the capability is disabled, and only the branch that is defined as the default is scanned.

> **Note:** To enable the Multi-Branch capability, contact OX Security Technical Support at <support@ox.security>, or contact your regional customer success manager.

**To define branches for scanning:**

1. Go to **Settings** > **Applications** and scroll down to the **Branch Scanning** section.

<figure><img src="/files/t5MO31pwS7wqrIIluX0c" alt="" width="352"><figcaption></figcaption></figure>

2. Enable **Multi-branch scan**.
3. To set specific branch names for scanning in all repos, add branch name(s) in the **Branches for scanning** box.

> **Note:**
>
> * If you request a branch that does not exist, the system creates an irrelevant application for this branch. For example, you request to scan the branch named `version-1-3-front-end`. OX platform searches all the repos for this branch name and creates irrelevant apps each time it is not found.
> * OX Security supports wildcards for branch scanning. You can use this to automatically capture any branch that follows a specific naming convention without having to add them manually. For example, if you type `test`, any branch with this word will be included.

2. Select **UPDATE**.

## Securing branches of an individual repo

When Multiple-branch scan is [enabled](#enabling-the-capability-and-securing-branches-in-all-repos), you can specify which branches to scan in each repo. You can scan up to 4 branches in each repo, the default branch and 3 other branches that you select.

When multiple branches are selected for scanning from a specific repo, OX designates one branch as the primary application. It’s marked with a unique icon and you can filter the Applications table using the Primary Application tag.

The primary application performs several roles, including receiving issues from third-party integrations, artifact scanners, Git posture, and cloud checks and so on.

<figure><img src="/files/LQGJclk9t5y0AZsa9ccL" alt="" width="563"><figcaption><p>Primary Application</p></figcaption></figure>

**To set branches for scanning in a specific repo:**

1. In the **Connectors** page, select the source control system that you use to integrate with the OX platform.
2. In the **Configure \[source control name] Credentials** dialog, select the gear icon next to **DELETE**.

<figure><img src="/files/g3QonGhbOsVL6Pzv4Qtv" alt="" width="321"><figcaption></figcaption></figure>

3. In the **Configure your** \[**source control name] Connector** dialog, select the repos that you want to scan.

<figure><img src="/files/wGo4qPSZZcoKukdJ68JR" alt="" width="266"><figcaption></figcaption></figure>

4. To specify which branches to scan in the selected repo, click the gear icon next to the repo and select up to 4 branches, including the default one, in the **Select Branches to Scan** dialog.

<figure><img src="/files/2sm3ZWI4aujBKGYr8WaV" alt="" width="360"><figcaption></figcaption></figure>

5. Click **SELECT**.

The **Select Branches to Scan** dialog closes.

> **Note:** Selecting specific branches for scanning overrides the global branch-scanning settings.

6. In the **Configure your** \[**source control name] Connector** dialog, select **SAVE**.

Changes take effect after the next scan.


---

# 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 dynamically by asking a question.

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

```
GET https://docs.ox.security/scan-and-analyze-with-ox/scanning/multi-branch-support.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
