Search code examples
jenkinsjenkins-pipelinemultibranch-pipeline

How to disable a specific branch in a Jenkins Multibranch job?


I have a multibranch job in my Jenkins, and it has been running on multiple branches over the last few months.
Now I finished working on some of the branches, and I want to prevent them from running again, but I didn't find a way to disable a branch.
Is there any way I can disable a specific branch without disabling the whole job?


Solution

  • Sure, that's possible. On the multibranch pipeline configuration, click Add -> Filter by name.
    Then, you can add the branch you want to disable on the Exclude text box, it will appear cross out on the multibranch view page.
    If you already use the Filter by name (with wildcard) for example, removing the branch name from the Include text box will disable the specific branch as well.