Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Push from github to heroku without downloading repo

Tags:

git

github

heroku

I have a github repo that I want to push to a heroku node. A 3rd host will be co-ordinating this. As I'm going to be doing this on a large scale I want to avoid having to download the contents of the repo onto the 3rd host. How do I do it?

like image 420
opsb Avatar asked Jul 24 '10 09:07

opsb


People also ask

How do I push from GitHub to Heroku?

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 do I push to Heroku without Git?

You can use a plugin heroku push that is built by one of the Heroku engineers. You can find it at https://github.com/ddollar/heroku-push.

How do I host my site from GitHub to Heroku?

Open the Deploy tab and scroll to the “Deployment method” section. Next, 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, accept it.


1 Answers

You can't push straight from Github to Heroku.

You're going to have to use the third host to coordinate the push. This could be fired from a Github post-receive hook.

To sync straight across use something like:

git remote add github [email protected]:user/repo.git git remote add heroku [email protected]:app.git  git push heroku refs/remotes/github/master:refs/heads/master 
like image 180
David Dollar Avatar answered Sep 21 '22 14:09

David Dollar