git remote heroku code example

Example 1: git remote

git remote add origin <repository url> # adds a repo to your project

git remote								# lists all the repos of your project
git config --get remote.origin.url		# prints the url of a repo
git push origin master					# updates the master branch of your repo

git remote remove origin				# removes the repo from your project

Example 2: git remote add heroku

heroku git:remote -a project

Example 3: git push to heroku

$ git push heroku master

Example 4: heroku git remote

heroku git:remote -a name-of-app

Example 5: deploy to heroku

$ git add .
$ git commit -m "Added a Procfile."
$ heroku login
Enter your Heroku credentials.
...
$ heroku create <app-name>
Creating arcane-lowlands-8408... done, stack is cedar
// now create procfile
//
//node app.js
// 
$ git push heroku master
-----> Node.js app detected
...
-----> Launching... done
       http://arcane-lowlands-8408.herokuapp.com deployed to Heroku

Example 6: set git remote heroku to https://git.heroku.com/resume-projects.git

$ git push heroku master
Initializing repository, done.
updating 'refs/heads/master'
...