'How to prevent Jenkins SCM polling from triggering a build on branch creation

I have git SCM polling set up in my Jenkins server job. I run the following commands on my local machine and they trigger a Jenkins build:

git checkout dev
git pull origin dev
git branch feature/new-feature
git checkout feature/new-feature
git push origin dev:feature/new-feature

Is there any way to prevent Jenkins SCM polling from triggering a build when the only thing that changed was branch creation (no new commits)?



Solution 1:[1]

You should configure the "Skip initial build on first branch indexing" option in your Jenkins project. For Multibranch project this option can be found behind the "Build strategies" section.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 cheburek