There is no option to specify additional remotes in the SCM configuration (for freestyle project).
There is also absolutely no info/documentation on how to properly set this up in the pipeline. Even knowing what I need to search for thanks to your links I didn't find any conclusive info on how to properly use `userRemoteConfigs` (though I can guess from some examples). Is this the only way?
Before that, I've tried consulting with several knowledgeable people, but they were also not aware of this feature.
What do you mean by the ""Advanced" button on the git repository configuration for Pipeline syntax."? There is no such thing. The declarative pipeline configuration is contained withing Jenkinsfile.
Freestyle project doesn't have advanced options, beside specifying name and refspec.
There is an option to add additional repositories, however it's not clear what it actually does and I assumed it just clones additional repositories, though now, it seems like it might've been what I was looking for. Then, this option should've been named "add remote" since it adds new remotes to the existing local repository. Of course only if it;s indeed what it does.
I don't know about multibranch. I've only tried freestyle and regular pipeline projects.
Thanks for the report. Can you provide more details to explain why you think the plugin does not support multiple remotes?
Multiple remotes are supported by Freestyle jobs. Refer to my JENKINS-55536 Freestyle job definition for the confirmation that Freestyle jobs support multiple remotes. Multiple remotes are under the "Advanced" button on the git repository configuration for Freestyle jobs.
Multiple remotes are supported by Declarative Pipeline and Scripted Pipeline jobs. Refer to the Jenkinsfile in my JENKINS-55536 branch to see the confirmation job that I've added to show multiple remotes in a Pipeline job. Multiple remotes are under the "Advanced" button on the git repository configuration for Pipeline syntax.
Because use of multiple remotes is an advanced feature, it is not included in the multibranch Pipeline user interface for GitHub branch source, Bitbucket branch source, or Gitea. Each of those branch sources use a more sophisticated web API to detect changes. That web API improves performance dramatically and reduces the load on the Jenkins master and the git hosting server. Even in those cases, multiple remote repositories can be defined and used within the Jenkinsfile hosted in the branches of those repositories (as shown in the Jenkinsfile).