Is there any way to use webhook only is there is a push on specific branch?
Under Source Code Management you would have selected Git option,There is an option Branches to build mention only the branch you wish to build e.g. foo
Further more there is a GitHub Branch Plugin in Jenkins, which allows you to add restrictions on branches, and provides more control on branches and how to build specific branches, you can find this option in trigger events-->Branch Restrictions
Hope this helps :)