tags:

views:

105

answers:

2

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?

A: 

I don't think you can push directly from GitHub to another remote repo.

So if you have many apps to push, you may consider an organization using submodules, like in this SO question.

You would still have to download a repo to push it on the Heroku node, but at least you can control what to pull/push (and do some cleaning between each push).

VonC
I won't actually be the owner of the apps(I'm building a cloud based service) so I won't have control over how they are organised.
opsb
+2  A: 

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
David Dollar
I've already got that working. It does look like there isn't going to be any way to avoid using the filesystem on the 3rd host :(
opsb
Added some git commands to the answer.
David Dollar
Not quite the answer I was looking for, but probably the most useful for people looking at this question.
opsb