8

Possible Duplicate:
git push to multiple repositories simultaneously

I want to let other people read my rails app from github.

So I usually push repos to github and heroku. Now I want to do both with one app and keep them synced. How do you do this?

Community
  • 1
  • 1
thenengah
  • 42,557
  • 33
  • 113
  • 157

1 Answers1

14

You can start by pushing to multiple repos at one (configured with git remote, like git remote set-url).

git remote add all github:path/proj.git
git remote set-url --add --push all url = heroku:path/proj.git

That would generate a config like:

[remote "all"]
  url = github:path/proj.git
  url = heroku:path/proj.git

then:

git push all --all.

If your repos are writable only for you, you don't need to fetch from all of them in one operation. You only need to keep them update in one push.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250