繁体   English   中英

你如何从nitrous.io推向GIT

[英]How do you push from nitrous.io to GIT

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

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

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

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

提前致谢。 :)

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

为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添加,提交,然后推送到origin master (Github)和heroku master (Heroku)。

如果您的Nitrous Box上有本地数据,这还不是git repo,您​​需要做的是:

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

从那里,您可以按照您在问题中提到教程中描述的步骤进行操作,但步骤7除外:您不需要克隆回购,因为您刚刚创建了回购。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM