'git push heroku master' is still asking for authentication

前端 未结 19 2574
囚心锁ツ
囚心锁ツ 2020-12-02 05:37

I have executed:

$ heroku login

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

$ git push heroku master
Usern         


        
相关标签:
19条回答
  • 2020-12-02 05:44

    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

    0 讨论(0)
  • 2020-12-02 05:44

    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

    0 讨论(0)
  • 2020-12-02 05:44

    If someone is still struggling with this, this answer helped me a lot Use Heroku API key.

    First, as @Raziza O mentioned in a comment, to get heroku API key

    https://dashboard.heroku.com/account. Roll down the screen and hit the reveal button.

    Then, just run git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git HEAD:master

    0 讨论(0)
  • 2020-12-02 05:44

    You have probably logged into heroku in two terminals, and if you try to run a command on first terminal, it will report such error, as new authentication was made in the second terminal.

    Either login again with heroku login and run commands in that terminal, or run commands in that second window (if you have it still open).

    0 讨论(0)
  • 2020-12-02 05:45

    I got around this by logging in with the following :

    username : email used to register to heroku (Also been able to leave this field blank)

    password : heroku auth token (API Key)

    where the auth token can be retrieved by $ heroku auth:token or via the Account Settings in Heroku

    0 讨论(0)
  • 2020-12-02 05:47

    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

    0 讨论(0)
提交回复
热议问题