Heroku 推送在 Windows + Git bash 中失败

Heroku push failed in Windows + Git bash

我执行:

> heroku login

并介绍我的 Heroku 用户名和密码,我得到:

Logged in as l*********.com

我可以执行成功:

> heroku auth:token
cccc8aa0-aaaa-aaaa-aaaa-bbbb03b38932

之后,我执行:

> git push heroku master

但我得到:

remote: !       WARNING:
remote: !       Do not authenticate with username and password using git.
remote: !       Run `heroku login` to update your credentials, then retry the git command.
remote: !       See documentation for details: https://devcenter.heroku.com/articles/git#http-git-authentication
fatal: Authentication failed for 'https://git.heroku.com/myapp.git/'

我做错了什么?它说我应该 "not authenticate with username and password using git".. 但在那种情况下,我该怎么办? docs 说:

You cannot authenticate with the Heroku HTTP Git endpoint using your Heroku username (email) and password. Use an API key as described in this section

但是很难理解我到底应该做什么。

我能够使用 SSH 协议修复它:

  1. 生成密钥:ssh-keygen -t rsa

  2. 上传到 Heroku heroku keys:add

  3. 切换到 SSH:git config --global url.ssh://git@heroku.com/.insteadOf https://git.heroku.com/