0

With an app in heroku, with git url like git@heroku.com:app.git, And a repo in github https://github.com/username/other_app.git

Is possible sync the two repos for hosting the sema app in two git servers (heroku and github) ?

And also Link Heroku app to Github repo. For what?

Community
  • 1
  • 1
richie-torres
  • 746
  • 1
  • 8
  • 29

2 Answers2

1

Yes of course this is possible, because git is a distributed repository. You can configure multiple remotes, one at GitHub and one at heroku, and just push your changes to both of them.

Example:

  1. Create repository at GitHub
  2. Clone this repository on your machine, now you have setup the remote "origin" to be GitHub
  3. Setup heroku and add the heroku git remote (either by running heroku create or heroku git:remote -a my_heroku_app). Find details in the git documentation of heroku.
Odi
  • 6,916
  • 3
  • 34
  • 52
0

here are some useful commands when working with github/heroku:

show github remote:

git remote show origin

show heroku git:

git remote show heroku

push github to heroku:

git push heroku master

if you have a 'staging' branch on github and want to push this to heroku git (master) for a 'staging app':

git push heroku staging:master -v

Jay
  • 21
  • 3