Interview Prep/Jenkins/SCM, multibranch & webhooks

`ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.`

BeginnerTroubleshootingSCM, multibranch & webhooks
Answer

Likely causes → The branch specifier does not match any branch (*/master on a repo that uses main), the refspec excludes it, or the credential cannot see the repo.

Diagnose → Run git ls-remote https://github.com/org/repo.git with the same credential; compare with the job's branch spec.

Fix → Set the branch spec to */main (or use multibranch so branches are discovered).

Prevent → Avoid single-branch Pipeline jobs for repos; use multibranch.

All Jenkins questions Roadmap: Jenkins

More on SCM, multibranch & webhooks