'git push heroku master' is still asking f

2019-01-12 17:26发布

I have executed:

$ heroku login

But when I try to push, I'm still asked for authentication:

$ git push heroku master
Username for 'https://git.heroku.com': <email>
Password for 'https://<email>@git.heroku.com':

Then I get a WARNING: Do not authenticate with username and password using Git.

I ran heroku login again and authenticated successfully but I still get the same failure.

I've checked the remote:

$ git remote -v
heroku https://git@heroku.com/appname.git (fetch)
heroku https://git@heroku.com/appname.git (push)

I've also generated a new public key, passed it to Heroku, and validated it: https://devcenter.heroku.com/articles/keys

I am on Windows 8, with Git 1.9.5.

14条回答
聊天终结者
2楼-- · 2019-01-12 17:46

I have exactly the same problem. The reason in my case, I used accidentally window console instead of Git bash

查看更多
再贱就再见
3楼-- · 2019-01-12 17:53

This topic is old, I know.

However, none of the previous solutions worked for me.

My problem was that "Windows Credentials" (os: Windows 10) had another credential previously associated with Heroku (company account) and used this instead of the new one (my personal account).

I had to go to: "Control Panel\All Control Panel Items\Credential Manager" (from Control Panel), and modify all the credentials: https://git.heroku.com (and all those associated with "heroku" word) with the account current.

However, the password I placed the Key API that is displayed in "Dashboard" of the site and the command works: git push heroku master.

7 hours that life will not give me back. :/

My 2 cents.

查看更多
我只想做你的唯一
4楼-- · 2019-01-12 17:54

From the Heroku documentation

Enter the following commands:

# Enable SSH authentication
$ heroku create --ssh-git

# Redirect tall HTTPS calls to SSH
$ git config --global url.ssh://git@heroku.com/.insteadOf https://git.heroku.com/
查看更多
做个烂人
5楼-- · 2019-01-12 17:55

I had the same problem (git couldn't authenticate). It happend that GIT wants to read auth data from %HOME%/_netrc file and on Windows you don't have this variable (only %USERPROFILE% and %HOMEDRIVE% + %HOMEPATH%)

i set HOME to %USERPROFILE% (the place where heroku saved _netrc file) and GIT started working

查看更多
Anthone
6楼-- · 2019-01-12 17:56

First find the _netrc file that is created by heroku. In windows it can be found in C:\Users\User Name\_netrc.

That file contains credentials for git.heroku.com

machine git.heroku.com
     login abcd123@gmail.com
     password xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Use that login and password when ask for authentication after $ git push heroku master command

查看更多
地球回转人心会变
7楼-- · 2019-01-12 18:01

If anybody else is trying to solve this on cygwin: http://www.railszilla.com/git-push-heroku-master-authentication/start rewriting to SSH transport did the trick for me:

git config --global url.ssh://git@heroku.com/.insteadOf https://git.heroku.com/
查看更多
登录 后发表回答