Error message:"This branch could not be compared to its reference branch. See the SCM or analysis r"

If I change that and for New Code > Project Settings I set “Reference Branch: Main”:

and for New Code > main branch I set “Previous version”.
after I push a new commit, it will be like this

is there any solution for this?


What’s your SonarQube version?

Also, just to be clear, what branch are you seeing the error on? Is it the one in the first screenshot?


Hi, Ann:
we use like

  • Enterprise Edition
  • Version 8.9.9"

is this the version you mentioned?
for now, I found that all new branched created after reference branch setting work well, the old branch still say" This branch could not be compared to its reference branch."


Have you tried re-analyzing those branches? It’s possible that message was generated before you chose your current setting.