My team found the usage of property
sonar.branch.name confusing. They executed the following command on a fresh, previously never analyzed Git repo:
sonar-scanner -Dsonar.branch.name=master ...
The result was:
ERROR: Project was never analyzed. A regular analysis is required before a branch analysis
While the documentation clearly says:
A branch is created when the sonar.branch.name parameter is passed during analysis.
It may not be so obvious, as it happened with us, thus I think there could be more emphasis in the documentation on the fact that we should never use the property for the main branch.
Thanks in advance.