Now open your github repository. Go to settings -> webhooks -> add webhooks.
paste the url in payload url field, select Just the push event, check active and finally save or update this.
Now go to jenkins project configuration. Check git m set git url and select ” github hook trigger for git scm polling” in the build triggers section . Save the changes.
It’s done. Now if you push in git then the job/project of Jenkins will automatically build according to github repo.