How do you push from nitrous.io to GIT
Asked Answered
B

2

6

I was following this 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. Well I really wanted to just push my stuff to Heroku. Argghh now I am lost.

So either push directly to Heroku or to Git and then on to Heroku.

Tutorial links always welcome if I have missed something.

Thanks in advance. :)

Baste answered 18/9, 2013 at 10:30 Comment(0)
C
14

You will need to add two remotes within the same project.

Initiate your project for Git

$ git init

To add Github remote to your project and push:

$ 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 create

$ git remote -v
# Verify new remote (you will see heroku and origin now
# heroku     [email protected]:falling-wind-1624.git (fetch)
# heroku     [email protected]: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).

Chingchinghai answered 18/9, 2013 at 15:12 Comment(1)
A more complete answer than mine. +1Wedged
W
2

If you have local data on your Nitrous Box, which isn't yet a git repo, what you need to do is:

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.

Wedged answered 18/9, 2013 at 11:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.