Limit POST Hook to git branch, not repository, on Bitbucket

Complicated title, let me explain.

I want to limit an automatic POST hook when I push to the master branch; so it won’t fire when I push to the dev branch. This is so the app will only deploy to the live servers when the changes have been merged with master and the new master passes the unit tests.

  • Git wrongly interprets that files names have changed after I pull
  • How to clone private BitBucket repository in GitHub desktop app
  • How to create pull request for wiki of a repository on Bitbucket?
  • Have Jenkins (Cloudbees) only build on change in specific branch
  • BitBucket colored diff email service
  • Error deploying to Azure through git (bitbucket hosted git repo)
  • Is this possible?

  • How to tell git to use the correct identity (name and email) for a given project?
  • Git commit fails: “assertion `g_type_from_name (name) == 0' failed”
  • Git - Permission denied (publickey)
  • Heroku local and remote repo's different name
  • What is the difference between git rm --cached and git reset <file>?
  • Where is the local repository located?
  • One Solution collect form web for “Limit POST Hook to git branch, not repository, on Bitbucket”

    You can’t limit when BitBucket fires its POST hook; but you can use the contents of the POST to make the decision about whether or not to proceed with the deployment. Just parse the JSON that BitBucket sends you and only continue if any of the "commits" elements have a "branch" of “master”, for example.

    Git Baby is a git and github fan, let's start git clone.