> For the complete documentation index, see [llms.txt](https://docs.sonarsource.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sonarsource.com/sonarqube-cloud/administering-sonarcloud/managing-organization/manage-org-projects/auto-import-new-repos.md).

# Auto-importing new repositories

How to automatically import new repositories from GitHub, GitLab, or Bitbucket Cloud.

*This feature is supported only for GitHub organizations, GitLab groups, and Bitbucket Cloud workspaces.*

## About this feature

With auto-import, newly created repositories in your GitHub organization, GitLab group, or Bitbucket Cloud workspace are automatically imported into SonarQube Cloud.

The feature is enabled by default when you create an organization by importing your GitHub organization, GitLab group, or Bitbucket Cloud workspace. You can turn it off during the import, and enable or disable it at any time in your SonarQube Cloud organization settings. If you bind an existing organization to a GitLab group or Bitbucket Cloud workspace, enable auto-import after binding.

When applicable, automatic analysis is turned on for the projects created through auto-import. See [Automatic analysis](https://docs.sonarsource.com/sonarqube-cloud/analyzing-source-code/automatic-analysis.md) for more information.

## Important notes

* For GitHub, select **All repositories** in GitHub’s Repository Access settings for your organization. See [Importing GitHub.com organization](https://docs.sonarsource.com/sonarqube-cloud/administering-sonarcloud/managing-organization/creating-organization/importing-github-organization.md#modifying-repository-access) for more information.
* For GitLab:
  * You need a Premium or Ultimate subscription.
  * The personal access token must belong to a group Owner, have the `api` scope, and allow access to the group’s parent groups and subgroups.
  * Only one group in a GitLab group hierarchy can use auto-import. If another SonarQube Cloud organization bound to a parent group or subgroup already uses it, disable it in that organization before enabling it for this group. This prevents the same repository from being imported into two organizations. Sibling groups can each use auto-import.
  * Personal GitLab groups are not supported.
  * Projects transferred into the group are not imported.
* For Bitbucket Cloud, connect your workspace through the **SonarQube Cloud for Bitbucket Cloud** Forge app. Connections through the deprecated Connect app are not supported. See [Migrating to the Bitbucket Forge app](https://docs.sonarsource.com/sonarqube-cloud/administering-sonarcloud/managing-organization/creating-organization/migrating-to-the-bitbucket-forge-app.md).
* A sudden spike in new repositories might cause you to reach your organization plan limits and pause analysis. New repositories are still imported. Ensure your plan grants enough private lines of code. See [Changing your subscription plan](https://docs.sonarsource.com/sonarqube-cloud/administering-sonarcloud/managing-subscription/changing-plan.md#changing-loc) for more information.
* Existing repositories are not imported when you enable auto-import. However, you can use the bulk import option to import all existing repositories in your organization. See [Creating your project](https://docs.sonarsource.com/sonarqube-cloud/managing-your-projects/administering-your-projects/setting-up-project.md#bulk-import) for more information.

## Enabling or disabling auto-import of new repositories <a href="#enabling-disabling-the-auto-import-of-new-github-repositories" id="enabling-disabling-the-auto-import-of-new-github-repositories"></a>

1. Retrieve your organization. See [Retrieving your organizations](https://docs.sonarsource.com/sonarqube-cloud/getting-started/viewing-organizations.md) for more information.
2. Go to **Administration** > **Organization settings** > **Organization binding**.
3. Select or unselect the option for your platform: **Automatically import new GitHub repositories**, **Automatically import new GitLab projects**, or **Automatically import new Bitbucket repositories**.

<figure><img src="broken://spaces/KXW79zfYFiA8incTvwZK/files/fe0wOpmka861gXxbWQRL" alt="Select or unselect the toggle to enable or disable the auto-import feature."><figcaption></figcaption></figure>

{% hint style="info" %}
You can also enable the feature during the import of a new organization. See [Importing GitHub.com organization](https://docs.sonarsource.com/sonarqube-cloud/administering-sonarcloud/managing-organization/creating-organization/importing-github-organization.md), [Importing GitLab group](https://docs.sonarsource.com/sonarqube-cloud/administering-sonarcloud/managing-organization/creating-organization/importing-gitlab-group.md), or [Importing Bitbucket workspace](https://docs.sonarsource.com/sonarqube-cloud/administering-sonarcloud/managing-organization/creating-organization/importing-bitbucket-workspace.md).
{% endhint %}

## Monitoring auto-import of new repositories <a href="#monitoring-the-auto-import-of-new-github-repositories" id="monitoring-the-auto-import-of-new-github-repositories"></a>

To check for failed imports:

1. Retrieve your organization. See [Retrieving your organizations](https://docs.sonarsource.com/sonarqube-cloud/getting-started/viewing-organizations.md) for more information.
2. Go to **Administration** > **Organization settings** > **Organization binding**. Failed imports appear under the **Automatically import new GitHub repositories**, **Automatically import new GitLab projects**, or **Automatically import new Bitbucket repositories** option.
3. Fix the cause reported for each failed repository, then import it manually. See [Creating your project](https://docs.sonarsource.com/sonarqube-cloud/managing-your-projects/administering-your-projects/setting-up-project.md#creating-manually).

## Fixing auto-import setup problems <a href="#fixing-setup-problems" id="fixing-setup-problems"></a>

If SonarQube Cloud cannot turn on auto-import, your organization remains bound to your DevOps platform, but auto-import stays off. Fix the reported problem, then enable auto-import again.

For GitLab, check that:

* The personal access token is valid and has the `api` scope.
* The token belongs to an Owner of the group.
* The token allows access to the group’s parent groups and subgroups.
* The group has a Premium or Ultimate subscription.
* No other SonarQube Cloud organization bound to a parent group or subgroup uses auto-import.

For Bitbucket Cloud, check that your workspace is connected through the **SonarQube Cloud for Bitbucket Cloud** Forge app. If SonarQube Cloud reports that it could not save or confirm your auto-import setting, your workspace is still connected. Reload the **Organization binding** page to check the saved setting, then try again.

## Related pages

* [Importing GitHub.com organization](https://docs.sonarsource.com/sonarqube-cloud/administering-sonarcloud/managing-organization/creating-organization/importing-github-organization.md)
* [Importing GitLab group](https://docs.sonarsource.com/sonarqube-cloud/administering-sonarcloud/managing-organization/creating-organization/importing-gitlab-group.md)
* [Importing Bitbucket workspace](https://docs.sonarsource.com/sonarqube-cloud/administering-sonarcloud/managing-organization/creating-organization/importing-bitbucket-workspace.md)
* [Creating your project](https://docs.sonarsource.com/sonarqube-cloud/managing-your-projects/administering-your-projects/setting-up-project.md#bulk-import)


---

# 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://docs.sonarsource.com/sonarqube-cloud/administering-sonarcloud/managing-organization/manage-org-projects/auto-import-new-repos.md?ask=<question>&goal=<user_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.
