LoginSignup
22
20

More than 5 years have passed since last update.

git-bash on windowsでherokuコマンドを使う方法

Last updated at Posted at 2018-02-17

背景

ちょっとHerokuに関して検証する必要がでてきて、HerokuCLI環境を作ることに。

私の環境はwindows64ビットです。

Heroku公式ページへ

まずは以下にアクセス
https://devcenter.heroku.com/articles/heroku-cli

HerokuCLIのインストール

まずは以下をクリックしてインストールします。
※自分のPCの環境に合わせましょう。私はwindows64ビットなので以下です。

https://gyazo.com/68a1f9a0f44a713e944af0cb30d5af2a

heroku-cli-x64.exeがダウンロードされます。
起動して全部デフォルトのままクリックしてインストールします。

ではgit-bash on windowsを起動して検証

まずはherokuコマンドが使えるか検証。

$ heroku --version
heroku-cli/6.15.26-5726b6f (win32-x64) node-v9.3.0

オッケー!使える!

では早速ログイン!

$ heroku login
Enter your Heroku credentials:
Email: hogehoge@gmail.com
 !    Login is currently incompatible with git bash/Cygwin/MinGW

ログインの互換性がないとのこと。。

当然heroku createでも以下の感じでログインが求められます。

$ heroku create
Creating app... !
 !    Invalid credentials provided.
Enter your Heroku credentials:
Email: hogehoge@gmail.com
 !    Login is currently incompatible with git bash/Cygwin/MinGW

じゃあどうするのか?cmdでログインだけします。

Windows基本機能のcmdでログインだけします。

Microsoft Windows [Version 10.0.16299.192]
(c) 2017 Microsoft Corporation. All rights reserved.

C:\Users\hogehoge>heroku login
Enter your Heroku credentials:
Email: hogehoge@gmail.com
Password: **************
Logged in as hogehoge@gmail.com

C:\Users\hogehoge>

おお、当然だが、cmdでは普通にログインできる。
その後、gitbashを起動してコマンド実行。

$ heroku create
Creating app... done, xxxx-xxxx-xxxx
https://xxxx-xxxx-xxxx.herokuapp.com/ | https://git.heroku.com/xxxx-xxxx-xxxx.git

ログインが求められない!いけた!

22
20
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
22
20