herokuのアプリ、のようなgit url git@heroku.com:app.git
、およびgithubのリポジトリhttps://github.com/username/other_app.git
2つのgitサーバー(herokuとgithub)でsemaアプリをホストするための2つのリポジトリを同期することは可能ですか?
herokuのアプリ、のようなgit url git@heroku.com:app.git
、およびgithubのリポジトリhttps://github.com/username/other_app.git
2つのgitサーバー(herokuとgithub)でsemaアプリをホストするための2つのリポジトリを同期することは可能ですか?
はい、もちろんこれは可能です。gitは分散リポジトリであるためです。1つはGitHubに、もう1つはherokuに、複数のリモートを構成して、変更を両方にプッシュすることができます。
例:
heroku create
)heroku git:remote -a my_heroku_app
。詳細については、herokuのgitドキュメントをご覧ください。github/herokuを操作するときに役立つコマンドを次に示します。
show github remote:
git remote show origin
heroku gitを表示:
git remote show heroku
githubをherokuにプッシュします:
git push heroku master
githubに「ステージング」ブランチがあり、これを「ステージングアプリ」のheroku git(マスター)にプッシュしたい場合:
git push heroku staging:master -v