LoginSignup
1
1

More than 5 years have passed since last update.

herokuにデプロイするgitをgithubにした時にherokuコマンドを使うときの設定

Last updated at Posted at 2016-01-28

前提

herokuにデプロイするgitをgithubにした時、herokuコマンドがどのアプリなのか指定がないので、そのままではherokuコマンドが使えない状態になります。別のherokuコマンドなどでappを設定できないか調べたが、特にそういうオプションはないので、下記の方法で解決。

解決法1

herokuコマンドでappを指定する方法で解決。

heroku open --app [heroku app name]

同じリポジトリで別のapp(staging用とか)などで利用している時はこちらがよさそう。

解決法2

git remoteにherokuのappも登録

heroku git:remote -a [heroku app name]

git remoteの名前が
origin: => github
heroku: => heroku

のようになります。

herokuコマンドは、git remoteに登録されているapp名で操作されるようなので、appが固定の場合はこちらで。

※参考

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1