Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploy a GitHub branch using heroku CLI

I want to do this action: enter image description here

using Heroku CLI.

If I have the remote git on my computer I can do git push my-heroku-remote master

But because my heroku app is already connected to the git project, I find this approach redundant.

Any ideas?

like image 597
YardenST Avatar asked Mar 18 '18 14:03

YardenST


People also ask

How do I Deploy Heroku to GitHub?

You can configure GitHub integration in the Deploy tab of apps in the Heroku Dashboard. To configure GitHub integration, you have to authenticate with GitHub. You only have to do this once per Heroku account. GitHub repo admin access is required for you to configure automatic GitHub deploys.

Can you push to Heroku and GitHub?

You can now push your project to GitHub and it will be automatically deployed to Heroku henceforth.

Can I Deploy private GitHub repo to Heroku?

Heroku Button is no longer limited to source code hosted in public GitHub repos. It now works with both public and private GitHub repos.


1 Answers

I prefer the GitHub auto-deployment over the git push heroku master because it works great with a GitHub Flow (Pull Requests to master). But if you would rather do manual deployments to Heroku from your dev machine you can fetch and push:

git fetch origin master:master
git push heroku master:master

(Assuming the GitHub remote is named origin and the Heroku remote is named heroku.)

like image 54
James Ward Avatar answered Sep 21 '22 12:09

James Ward