I have more than one app/git remote at heroku and I would like to know if it is possible to configure a default application so that, whenever I forget to specify the app (--app
), the toolbelt would use it.
You can set the heroku.remote
key in your repo's Git config to the name of the default remote. For example, if your remote is called staging
, you could do this:
$ git config heroku.remote staging
To see how this works, here is the relevant source.
For more, information about this, see Managing Multiple Environments for an App.
--app
. It's not working for me: –
Halting git remote -v
results? –
Backspin heroku
as default (ref. devcenter.heroku.com/articles/git#for-a-new-heroku-app). So many users should set heroku
instead of staging
(i.e. $ git config heroku.remote heroku
). The remote name can be checked by $ git remote -v
. If the output is like this: git-remote-name https://git.heroku.com/your-heroku-app-name.git
, you should type $ git config heroku.remote git-remote-name
. –
Allier git config heroku.remote heroku
and then heroku git:remote -a <app-name>
–
Fresher You could also go for:
heroku git:remote -a <name-of-the-app>
or if you tend to make a lot of mistakes in the configuration of wrong apps, you can use this library I made: https://github.com/kubek2k/heroshell
This is a Heroku wrapper shell that allows you to work in the context of a given Heroku application
You can set the HEROKU_APP
environment variable.
Found this question while searching for it myself. The other answers refer to Heroku's old ruby-based CLI. The new JS CLI doesn't seem to support the same git-remote-reading feature. A quick search of the source code on GitHub found this.
© 2022 - 2024 — McMap. All rights reserved.