# Support for Multi-Branch Scanning

**Table of contents:**

* [Use Cases](#use-cases)
* [Prerequisites](#prerequisites)
* [Adding multiple branches](#adding-multiple-branches)

## Support for Multi-Branch Scanning

Multi-branch scanning in Aikido allows developers to scan multiple legacy branches at the same time or is useful when you want to scan both your staging and production environment at the same time. You can add as many branches as you want. This is typically used when branches exist for months and continuous scanning is needed.

#### Use Cases <a href="#use-cases" id="use-cases"></a>

* You have old legacy branches that needs daily scanning (eg branch V3, branch V4), that live in parallel, and you want to scan both as separate projects, even though they are in the same repository.
* You want to continuously monitor your staging and production environments

> In case you are looking to scan feature branches that get merged within a couple of days or weeks, we suggest looking into our [CI gating functionality](/pr-and-release-gating/aikido-ci-gating-functionality.md).

### Adding multiple branches <a href="#adding-multiple-branches" id="adding-multiple-branches"></a>

**Step 1:** Navigate to your repository's detail page and click on the current branch name (often tagged master). This action will open a modal window.

![NodeGoat GitHub repository showing the master branch and total issues count.](/files/9Z9XeYgqczp7dgXoqCin)

**Step 2:** Click 'Scan multiple branches.’\
​

![Branch selection dialog with options to scan single or multiple branches.](/files/64sg3H9aXupK6sCgQk2W)

**Step 3:** Enter the name of the branch you wish to add to the scanning process.\
​

![Form to select and update branches for scanning in a repository.](/files/PSE5WaGOeSiQyeG8kHjp)

**Result:** Aikido clones the specified repo and scans the repository nightly, or you can trigger a scan manually for instant results. A label will appear next to the cloned repo so you know which repo contains which branch that is being scanned.

**Looking to scan more than 2 branches?** You can go into any of the repositories and go through this process again.

![Repository list with configuration options and a master copy label for one repo.](/files/QUwEyZHJCyiEAH5BmIhq)

> Note: It's important to note that secret scanning is conducted only on the initial repository. This is because the secret scanning feature is designed to automatically cover all branches by default.

***


---

# 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://help.aikido.dev/code-scanning/miscellaneous/support-for-multi-branch-scanning.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.
