Answers: <p>Finally I have resolved it with the help of "strategy of choosing what to build" with "Default behavior" for each branch.</p>
  
Answers: CC BY-SA 3.0
Answers: 2018-04-06T10:27:06.127Z
Answers: Please elaborate your answer. Your answer will help others as well, so adding more explanation and a screenshot always helps :)
Answers: Vish
Answers: CC BY-SA 3.0
Answers: 2018-04-05T20:17:55.947Z
Answers: 2018-04-05T20:17:55.947Z
Answers: user541
Body: <p>I am using Jenkins2 and GitHub plugin for triggering <strong>Push</strong> events.</p>
  
  <p>I have the next service (Jenkins Github): <a href="http://myjenkinsmaster/github-webhook/" rel="nofollow noreferrer">http://myjenkinsmaster/github-webhook/</a></p>
  
  <p>I also have 3 branches: <code>dev</code>, <code>stage</code>, <code>master</code> which need to be built.</p>
  
  <p>But I require only the branch with changes to be built. </p>
  
  <p>For example if changes were pushed to <code>dev</code>, only <code>dev</code> branch will be built, and others ignored. </p>
  
  <p>However, Jenkins builds all 3 branches which I specified in branch field in job config. </p>
  
  <p>How can I achieve a Jenkins build that builds only the branch where changes were pushed?</p>
  
Comments: CC BY-SA 4.0
Comments: 2018-06-06T14:22:17.620Z
Comments: Do you use pipelines for jenkins jobs?
Comments: Here_2_learn
Tags: <jenkins><jenkins-plugins><github>
Title: Github plugin triggering to push event only for changes in specific branches
UserDisplayName: user541
ThreadText: # Github plugin triggering to push event only for changes in specific branches
  
  (Asked by: username_0 on 2018-04-05)
  
  I am using Jenkins2 and GitHub plugin for triggering **Push** events.
  
  I have the next service (Jenkins Github): <http://myjenkinsmaster/github-webhook/>
  
  I also have 3 branches: `dev`, `stage`, `master` which need to be built.
  
  But I require only the branch with changes to be built.
  
  For example if changes were pushed to `dev`, only `dev` branch will be built, and others ignored.
  
  However, Jenkins builds all 3 branches which I specified in branch field in job config.
  
  How can I achieve a Jenkins build that builds only the branch where changes were pushed?
  
  **Tags:** jenkins, jenkins-plugins, github
  
  > **Comments:**
  > **username_1**: Do you use pipelines for jenkins jobs?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2018-04-05. Score: 1
  
  Finally I have resolved it with the help of "strategy of choosing what to build" with "Default behavior" for each branch.
  
  > **Comments:**
  > **username_2**: Please elaborate your answer. Your answer will help others as well, so adding more explanation and a screenshot always helps :)  
  
  ---
  
  