Search code examples
herokuheroku-toolbelt

How do I run heroku-toolbelt commands without the `--app` parameter


I used to run heroku create and deploying with git push heroku master but I've since moved onto a Github based workflow where code is first pushed to my Github repo, and deployed via a web hook.

I now have to run --app appname or -a appname after every command, and it gets annoying.

e.g.

heroku run rails db:migrate -a appname # instead of
heroku run rails db:migrate

heroku run rails console -a appname # instead of
heroku run rails console

heroku run logs -t -a appname # instead of
heroku run logs -t

How do I force heroku-toolbelt to link this repo to the heroku app so that I can run heroku without the --app parameter


Solution

  • Add a remote named heroku with the url https://git.heroku.com/appname.git

    Run this:

    $ git remote add heroku https://git.heroku.com/appname.git