Scanning showing success but "main branch of this project is empty"

Also, when I go into the project overview there is a message indicating “The main branch has no lines of code.”

And I do see a warning message in SonarCloud indicating “SCM provider autodetection failed. Please use “sonar.scm.provider” to define SCM of your project, or disable the SCM Sensor in the project settings.”