OpenShift configure which branch to deploy

Note to self: this is a copy from the OpenShift documentation :

Configuring Which Branch to Deploy
By default OpenShift deploys the master branch when you do a git push (when automatic deployments are enabled). You can change this behavior using the rhc app-configure –deployment-branch command, where is the new branch to deploy.

$ rhc app-configure  --deployment-branch  # Master is the Default
$ rhc app-configure myapp --deployment-branch new_branch
 Configuring application 'myapp' ... done
myapp @ http://myapp-osexample.rhcloud.com/ (uuid: 54da3b4be0b8cd64a2000010)
 ----------------------------------------------------------------------------
 Deployment: auto (on git push)
 Keep Deployments: 5
 Deployment Type: git
 Deployment Branch: new_branch

Your application 'myapp' is now configured as listed above.

Now when you make commits to your new branch and do a git push to OpenShift, those changes will be deployed.