Skip to content

Instantly share code, notes, and snippets.

@garudareiga
Last active December 20, 2015 06:18
Show Gist options
  • Save garudareiga/6084325 to your computer and use it in GitHub Desktop.
Save garudareiga/6084325 to your computer and use it in GitHub Desktop.
Heroku CLI with Git

Heroku Apps

Create a Heroku app from a git repo and verify the remote in your git configuration

$ heroku create
$ git remote -v

Add an existing Heroku app to a git repo

$ git remote add heroku git@heroku.com:<project>.git 

Create a named app

$ heroku apps:create example123
$ heroku apps
$ heroku apps:info --app example123

Heroku Branch

View remote Heroku branch from a git repo

$ git remote show heroku

Delete a remote Heroku branch

$ git push heroku :master

Deploy Code

Push the master branch

$ git push heroku master

Create a local tracking branch heroku_dev, and push to heroku/master

$ git checkout -b heroku_dev -t heroku/master
$ git config remote.heroku.push heroku_dev:master
$ git push heroku
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment