你如何从nitrous.io推向GIT

Rog*_*lls 6 git ruby-on-rails github heroku nitrousio

我正在遵循本指南Nitrous to Heroku Guide

它描述了分叉git repo的过程,但我想将我的目录推送到Git然后再推送到Heroku.好吧,我真的很想把我的东西推给Heroku.阿格现在我迷路了.

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

如果我错过了某些内容,我们会欢迎教程链接.

提前致谢.:)

Gre*_*reg 14

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

为Git启动你的项目

$ git init
Run Code Online (Sandbox Code Playgroud)

要将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
Run Code Online (Sandbox Code Playgroud)

要创建一个新的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
Run Code Online (Sandbox Code Playgroud)

这是一个标准策略,您每次都想要git添加,提交,然后推送到origin master(Github)和heroku master(Heroku).

  • 一个比我更完整的答案.+1 (2认同)