Automatically remove Sonarqube branch projects when git branch merged / removed

The best way to remove SonarQube branch projects is to not push them to the server in the first place. Here are your options:

  • use SonarLint to spot issues directly in your IDE
  • if you're using GitHub, use the GitHub Plugin
  • if you're using BitBucket, use this plugin or this one

At SonarSource, we use SonarLint and the GitHub Plugin on a daily basis. One last solution is to delete manually the project using the api/projects/delete web service.


If you happen to be using Bitbucket Server and the Sonar for Bitbucket Server add-on, there's an automatic way to perform this cleanup. To enable this setting from Bitbucket Server, follow the 3 steps shown in the screenshots below.

Screenshot of 3 steps