'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条回答
Ridiculous、
2楼-- · 2019-01-12 18:02

Username: the email you used for registering to Heroku
Password: the API key which Heroku provides you with, in your Account Settings on Heroku website

This worked for me

查看更多
成全新的幸福
3楼-- · 2019-01-12 18:04

This happens because git and heroku aren't using the same _netrc file. This is something I'm trying to fix, but you can help me out by finding where your _netrc file should be and where the CLI is putting it.

The following will output potential sources of where the _netrc file could be:

> echo %HOME%
> echo %HOMEDRIVE%%HOMEPATH%
> echo %USERPROFILE%

You could try to add the _netrc file into one of them to find the one that matches. Let me know which has the _netrc file, and where you are able to put it and have git pick it up by not asking you for the username/password.

Also check your .gitconfig to see if there are any git credential helpers, that may be causing an issue.

查看更多
The star\"
4楼-- · 2019-01-12 18:06

What I did was open git bash instead of command prompt and type "git push heroku master". It worked :D

查看更多
Deceive 欺骗
5楼-- · 2019-01-12 18:07

Renaming the _netrc file to .netrc on Windows 7 in the userdir worked for me.

..after trying all the steps in many other tutorials.

Run the 3rd command in cmd in your userdir or the whole combo:

setx HOME %USERPROFILE%
cd %HOME%
REN _netrc .netrc
查看更多
地球回转人心会变
6楼-- · 2019-01-12 18:08

Pardon for the late reply, but I have fixed my problem two months ago. (Just haven't marked the question as answered. /noob)

SSH Fingerprint not authorized on Heroku after git restore

查看更多
够拽才男人
7楼-- · 2019-01-12 18:08

I fixed this by changing the http address to ssh://git@heroku/...

查看更多
登录 后发表回答