Interview Prep/Jenkins/Multibranch, organization folders & webhooks

What does `checkout scm` actually check out in a multibranch job?

AdvancedConceptMultibranch, organization folders & webhooks
Answer

scm is the SCM object for the exact revision that triggered the build, as resolved during indexing. For a branch, it is the branch head commit; for a PR with merge strategy, Jenkins fetches the PR head and merges it with the target branch locally. This guarantees the build uses the same revision whose Jenkinsfile was loaded, even if new commits arrive meanwhile.

All Jenkins questions Roadmap: Jenkins

More on Multibranch, organization folders & webhooks