How can I tell Jenkins to compile some, but not all branches of a repository?

At my place of work, we use a 2 letter coded naming convention when creating git branches.
For example, feature Apple, might be ftr_ap_hotfix and feature Orange might be done in branch ftr_or_hotfix.

I want to create two separate jobs in Jenkins. One job should compile all branches that match the name **_ap_** and the other job should compile all branches that match the name **_or_**

  • GIT Submodules feature without an existing path
  • How to keep multiple copies of a file in single Git branch?
  • How do I avoid continual issues with multiple programs (git, ruby, python) and default network drive path problems?
  • Combining history of merged branches in GIT?
  • git push(or pull) along with local history
  • Uncaught (In Promise) TypeError: Failed to Fetch - In Service worker when offline
  • However, when I set this up, Jenkins is compiling all branches no matter their name.

    What am I doing wrong? Is there a better way to do this?

    The only help I get from the Jenkins page is as follows:

    Specify the
    branches if you’d like to track a specific branch in a repository. If
    left blank, all branches will be examined for changes and built. The
    syntax is of the form: REPOSITORYNAME/BRANCH. In addition, BRANCH is
    recognized as a shorthand of */BRANCH, '*' is recognized as a
    wildcard, and '**' is recognized as wildcard that includes the
    separator ‘/’. Therefore, origin/branches* would match
    origin/branches-foo but not origin/branches/foo, while
    origin/branches** would match both origin/branches-foo and

  • Tortoise GIT: go back to previous version
  • Switch branch without committing the working code
  • git remote pack file is larger than local pack file
  • bower registering local git package
  • Accidentally reverted to master, lost uncommitted changes
  • Can't clone heroku app
  • One Solution collect form web for “How can I tell Jenkins to compile some, but not all branches of a repository?”

    As commented, It might be possible that it would work only for hierarchical branch names:


    , instead of part of a branch name.
    So a naming convention like:

    • ftr/or/hotfix, with pattern ‘*/or/*‘ or ‘**/or/**
    • ftr_or/hotfix, with pattern ‘ftr_or/**

    could work better.

    Git Baby is a git and github fan, let's start git clone.