【发布时间】:2014-05-08 02:51:42
【问题描述】:
在 heroku 中有一个应用程序,带有 git url,如 git@heroku.com:app.git,
以及 github 中的一个 repo https://github.com/username/other_app.git
是否可以同步两个存储库以在两个 git 服务器(heroku 和 github)中托管 sema 应用程序?
【问题讨论】:
在 heroku 中有一个应用程序,带有 git url,如 git@heroku.com:app.git,
以及 github 中的一个 repo https://github.com/username/other_app.git
是否可以同步两个存储库以在两个 git 服务器(heroku 和 github)中托管 sema 应用程序?
【问题讨论】:
是的,当然这是可能的,因为 git 是 distributed repository。您可以配置多个遥控器,一个在 GitHub,一个在 heroku,然后将您的更改推送到它们。
例子:
heroku create 或heroku git:remote -a my_heroku_app)。在git documentation of heroku 中查找详细信息。【讨论】:
这里有一些在使用 github/heroku 时有用的命令:
显示 github 远程:
git 远程显示来源
显示 heroku git:
git 远程显示 heroku
将github推送到heroku:
git push heroku 大师
如果你在 github 上有一个 'staging' 分支并且想要将它推送到 heroku git (master) “暂存应用”:
git push heroku staging:master -v
【讨论】: