For examplification purposes, let’s use 5 branches: (master, develop, test1, test2, test3).
We need to trigger a build only from two branches: (master, develop)
...
Select “Build from“ and enter branch names separated by white space: “master develop“
Select “Build RegExp“ and enter regexp based expression: “master|develop“
Note
Jenkins jobs must be configured for master branch.
Alternatively, branch parameter can be set when using integration with Git Plugin. On hook settings set “Parameters“ field to this:TARGET_BRANCH={BRANCH}
That’s how you trigger multiple branch builds.