Deploying to Heroku using git on bitbucket Deploying to Heroku using git on bitbucket git git

Deploying to Heroku using git on bitbucket


Deploying to Heroku should work regardless of where you host your code as the Heroku CLI adds it's own git remote for the sake of deployments. In fact, you can even git pull from Heroku, so you could technically use Heroku as a private git repository instead (though not recommended). As for using the GitHub client to connect to bitbucket, simply change the repository remote to the URL provided by bitbucket in the settings tab of the client.


Just to add to zeiv's answer who said it should work: I can confirm that it does. We use bitbucket for git hosting and deploy to heroku. What you can't seem to do is add your bitbucket repo to your heroku account to have commit history show up, this feature seems to be currently limited to github (heroku's fault ;-)


Bitbucket supports now Pipelines, which should make it pretty easy to deploy on Heroku. Just follow this tutorial: https://confluence.atlassian.com/bitbucket/deploy-to-heroku-872013667.html

My bitbucket-pipelines.yml to just push the master branch to Heroku looks like this:

image: node:6clone:  depth: fullpipelines:  branches:    master:      - step:          script:            - git push -f https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git $BITBUCKET_BRANCH