Start Free
Latest | Analyzing source code | Branch analysis | Introduction

Introduction to the branch analysis

On this page

Branch analysis is available starting in Developer Edition.

The branch analysis allows you to trigger an analysis on a push to any specified branch (not just the main branch) without involving pull requests. This capability can be useful in the following situations:

  • If your project has long-living branches other than the main branch that you want to analyze. One use case is having branches for older versions of your software that you still periodically update with critical fixes. Another is having separate branches for development and production in your project.
  • If you use short-lived branches (for example, “feature” branches) to introduce changes to your main branch but do not use them with a pull request mechanism in a supported CI.

You can limit the branch analysis to relevant branches only.

Clean as You Code

The quality gate of your project applies to your branch (you cannot define a quality gate at the branch level). It lets you know if your branch is ready to be merged. 

New code can be defined at the branch level.

Incremental branch analysis

Some analyzers use the analysis cache mechanism to shorten the branch analysis. This way, they analyze only the code sections that are affected by the changes in the branch compared to the previous analysis.

Issue synchronization

SonarQube Server synchronizes issue attributes (status, assignee, change log, comments) between branches when a branch is created or (under particular conditions) merged. For more information, see the corresponding section on the Issue management solution overview page.


Was this page helpful?

© 2008-2024 SonarSource SA. All rights reserved. SONAR, SONARSOURCE, SONARQUBE, and CLEAN AS YOU CODE are trademarks of SonarSource SA.

Creative Commons License