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?
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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With