【问题标题】:How do you push from nitrous.io to GIT你如何从 nitrous.io 推送到 GIT
【发布时间】:2013-09-18 10:30:00
【问题描述】:

我一直在关注本指南Nitrous to Heroku Guide

它描述了 fork git repo 的过程,但我想将我的东西目录推送到 Git,然后推送到 Heroku。好吧,我真的很想把我的东西推到 Heroku。 Argghh 现在我迷路了。

所以要么直接推送到 Heroku,要么推送到 Git,然后再推送到 Heroku。

如果我遗漏了什么,欢迎使用教程链接。

提前致谢。 :)

【问题讨论】:

    标签: ruby-on-rails git heroku github nitrousio


    【解决方案1】:

    您需要在同一个项目中添加两个遥控器。

    启动您的 Git 项目

    $ git init
    

    将 Github 远程添加到您的项目并推送:

    $ git remote add origin https://github.com/user/repo.git
    # Set a new remote
    
    $ git remote -v
    # Verify new remote
    # origin  https://github.com/user/repo.git (fetch)
    # origin  https://github.com/user/repo.git (push)
    
    $ git add .
    $ git commit -m "initial commit"
    $ git push origin master
    

    要创建一个新的 Heroku 项目并将远程推送到您的项目:

    $ heroku create
    
    $ git remote -v
    # Verify new remote (you will see heroku and origin now
    # heroku     git@heroku.com:falling-wind-1624.git (fetch)
    # heroku     git@heroku.com:falling-wind-1624.git (push)
    # origin  https://github.com/user/repo.git (fetch)
    # origin  https://github.com/user/repo.git (push)
    
    $ git push heroku master
    

    这是一个标准策略,您每次都需要 git add、提交,然后推送到 origin master (Github) 和 heroku master (Heroku)。

    【讨论】:

    • 比我的更完整的答案。 +1
    【解决方案2】:

    如果您的 Nitrous Box 上有本地数据,但它还不是 git 存储库,您需要做的是:

    cd /path/to/stuff
    git init
    git add .
    git commit -m "Make stuff into a git repo"
    

    从那里,您可以按照tutorial you mention in your question 中描述的步骤进行操作,但第 7 步除外:您不需要克隆存储库,因为您刚刚创建了一个。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-29
      • 2014-01-06
      • 2010-10-10
      • 1970-01-01
      • 1970-01-01
      • 2021-10-24
      • 2016-08-21
      • 1970-01-01
      相关资源
      最近更新 更多