【问题标题】:git with app in heroku and githubgit with app in heroku 和 github
【发布时间】: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 应用程序?

还有Link Heroku app to Github repo. For what?

【问题讨论】:

    标签: heroku github


    【解决方案1】:

    是的,当然这是可能的,因为 git 是 distributed repository。您可以配置多个遥控器,一个在 GitHub,一个在 heroku,然后将您的更改推送到它们。

    例子:

    1. Create repository at GitHub
    2. 在您的计算机上克隆此存储库,现在您已将远程“源”设置为 GitHub
    3. 设置heroku 并添加heroku git 远程(通过运行heroku createheroku git:remote -a my_heroku_app)。在git documentation of heroku 中查找详细信息。

    【讨论】:

      【解决方案2】:

      这里有一些在使用 github/heroku 时有用的命令:

      显示 github 远程:

      git 远程显示来源

      显示 heroku git:

      git 远程显示 heroku

      将github推送到heroku:

      git push heroku 大师

      如果你在 github 上有一个 'staging' 分支并且想要将它推送到 heroku git (master) “暂存应用”:

      git push heroku staging:master -v

      【讨论】:

        猜你喜欢
        • 2011-02-02
        • 2016-10-07
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-03-14
        • 2019-01-16
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多