Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying to Heroku using git on bitbucket

I want to host my source on bitbucket using git because I obviously get a free private repo and I want to host my app on heroku using the source code from bitbucket.

Can i do it using the github client and heroku toolbelt. Will it work? Github is great but i dont want everyone seeing my code and I dont want to pay for a private repo because its a small project.

like image 945
Wasswa Samuel Avatar asked Nov 05 '12 20:11

Wasswa Samuel


People also ask

How do I deploy Heroku with an existing Git repository?

To deploy your app to Heroku, use the git push command to push the code from your local repository's main branch to your heroku remote. For example: $ git push heroku main Initializing repository, done.

How does Heroku work with Git?

The Heroku platform uses Git as the primary means for deploying applications (there are other ways to transport your source code to Heroku, including via an API). When you create an application on Heroku, it associates a new Git remote, typically named heroku , with the local Git repository for your application.

How do I link a GitHub repo to Heroku?

Open Deploy tab and scroll to the “Deployment method” section. Select GitHub as the method. It will show a “Connect to GitHub” option where we can provide our GitHub repository. If you are doing it for the first time, Heroku will ask permission to access your GitHub account.

Can you push to Heroku without GitHub?

You can use https://github.com/ddollar/heroku-push and push directories without git.


Video Answer


1 Answers

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.

like image 159
Xavier Avatar answered Sep 20 '22 08:09

Xavier