How can I make Jenkins CI with Git trigger on pushes to master?

I’m trying to set up Jenkins-ci for a project using GitHub. I’ve already set up Jenkins with the appropriate plugins. I want Jenkins to run build scripts only whenever someone on the project pushes to master. So far I’ve been able to set it up so that a build will be triggered anytime anyone pushes to anywhere, but that is too broad. I’ve done this with post-receive service hooks on Git.

I’ve read the Jenkins wiki, and a couple of tutorials, but this particular detail is missing… is it something to do with polling maybe? Or should work be done on the Git side, so that Git only triggers Jenkins when master is changed?

14 Answers
14

Leave a Comment