title: gitlab trigger pipeline for specific branches only
body: <p>I have configured gitlab ci/cd pipeline for my project. So I have used base template which has 2 stages, build &amp; package. Build stage builds project and create jar file and package stage create image and store it in container registry. And .gitlab-ci.yml file has been created. Below is file</p>
  
  <pre><code>image: docker:latest
  services:
    - docker:dind
  
  stages:
    - build
    - package
  
  build:
    image: gradle:5.6.1-jdk11
    stage: build
    script:
      - gradle clean build -x test
    artifacts:
      paths:
        - build/libs/*.jar
  
  package:
    stage: package
    script:
      - docker build -t registry.gitlab.com/my-project/sample .
      - docker login -u $CI_DOCKER_USERNAME -p $CI_DOCKER_PASSWORD registry.gitlab.com
      - docker push rregistry.gitlab.com/my-project/sample
  </code></pre>
  
  <p>When we want to add new functionality we obviously create new branch and since this file exist in the new branch too, build is getting triggered. But I dont want to trigger a build for all the branches. I want to trigger only development and master. Is there anyway we can do that at project level instead of adding <code>only</code> in each stage</p>