简体   繁体   English

你如何从nitrous.io推向GIT

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

I was following this guide Nitrous to Heroku Guide 我正在遵循本指南Nitrous to Heroku Guide

It describes the process to fork a git repo but I want to push my directory of stuff to Git and then to Heroku. 它描述了分叉git repo的过程,但我想将我的目录推送到Git然后再推送到Heroku。 Well I really wanted to just push my stuff to Heroku. 好吧,我真的很想把我的东西推给Heroku。 Argghh now I am lost. 阿格现在我迷路了。

So either push directly to Heroku or to Git and then on to Heroku. 所以要么直接推送到Heroku,要么推送到Git,然后直接推送到Heroku。

Tutorial links always welcome if I have missed something. 如果我错过了某些内容,我们会欢迎教程链接。

Thanks in advance. 提前致谢。 :) :)

You will need to add two remotes within the same project. 您需要在同一个项目中添加两个遥控器。

Initiate your project for Git 为Git启动你的项目

$ git init

To add Github remote to your project and push: 要将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

To create a new Heroku project and push the remote to your project: 要创建一个新的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

This is a standard strategy which you will everytime want to git add, commit, and then push to both origin master (Github) and heroku master (Heroku). 这是一个标准策略,您每次都想要git添加,提交,然后推送到origin master (Github)和heroku master (Heroku)。

If you have local data on your Nitrous Box, which isn't yet a git repo, what you need to do is: 如果您的Nitrous Box上有本地数据,这还不是git repo,您​​需要做的是:

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

From there, you can follow the steps described in the tutorial you mention in your question , except for step 7: you don't need to clone a repo, since you just created one. 从那里,您可以按照您在问题中提到教程中描述的步骤进行操作,但步骤7除外:您不需要克隆回购,因为您刚刚创建了回购。

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

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