Trigger a build from specific branch only

Hi,

I am trying to get build from speciifc branch, using Jenkins and Bitbucket.
I have tried the following steps mentioned on below links but build is getting triggered while any branch have code pushed. I am looking the build from specific branch while code pushed only.

That guide is for a freestyle project on GitHub. Are you using a freestyle project or Pipeline?

With Pipeline, one way would be to define a Multibranch Pipeline project using the Bitbucket Branch Source plugin and then add the “Filter by name (with wildcards)” behaviour. There may be better ways, though.