Skip to end of metadata
Go to start of metadata
By SonarSource – GNU LGPL 3 – Issue TrackerSources – Supported by SonarSource
More versions
SonarQube :: Plugins :: SCM :: Git 1.3 – Oct 20, 2017 – SonarQube 6.7+ (Compatible with LTS)
Support of branches
DownloadRelease notes


Implements SCM dependent features of SonarQube for Git projects. Pure Java implementation so no need to have Git command line tool installed on the computer doing the SQ analysis.


Install the plugin in SonarQube. Auto-detection will work if there is a .git folder in the project root directory or in one of its parent folders. Otherwise you can force the provider using -Dsonar.scm.provider=git. A full clone is required to collect the required blame information (see Known Issues).

Known Issues

  • Trying to collect blame on a shallow clone may either collect incorrect data or fail with an error like: 
    ERROR: Caused by: Unable to blame file some/file.xy
    ERROR: Caused by: Missing commit 2f7227db7567a8858495074e8ceb915cd0f54ddd
    Full clone is required to collect all needed information.
  • Git doesn't consider old "Mac" line ends (CR) as new lines. As a result the blame operation will contains fewer lines than expected by SonarQube and will fail the analysis. The solution is to fix line ends to use either Windows (CR/LF) or Unix (LF) line ends.
  • JGit doesn't support .mailmap file to "clean" email adress during the blame

Advanced information

The plugin uses the JGit pure Java implementation of Git client:

How to investigate error during blame (only possible on Unix/Linux)?

If you get an error when blame is executed on a file this may be a limitation or a bug in JGit. To confirm please follow these steps:

1 - Identify version if JGit that is used:

SonarQube Git PluginJGit

2 - Download standalone JGit command line distribution<version>/org.eclipse.jgit.pgm-<version>

3 - Try to execute the blame command on the offending file

chmod +x /where/is/org.eclipse.jgit.pgm-<version>
/where/is/org.eclipse.jgit.pgm-<version> blame -w /path/to/offending/file

4 - If you get the same error than during the SQ analysis then this really looks like a bug in JGit (especially if you don't have issue with the native git command line tool). Please try to do previous steps with latest version of JGit and report all informations on SonarQube Google group.


  • No labels