'git push heroku master' is still asking for authentication

前端 未结 19 2575
囚心锁ツ
囚心锁ツ 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:49

    To generate a long term heroku token use:

    heroku authorizations:create
    

    Sample Output:

    Creating OAuth Authorization... done
    Client:      <none>
    ID:          XXXXXXXX-XXXX-4c9c-85f2-554f0f0c14fa
    Description: Long-lived user authorization
    Scope:       global
    Token:       XXXXXXXX-XXXX-4ad5-ac64-44bbc01c2d95
    Updated at:  Wed Mar 04 2020 12:00:00 GMT+0000 (Greenwich Mean Time) (less than a minute ago)
    

    Then use the following info for git:

    username: blank (type the word blank)
    pass: XXXXXXXX-XXXX-4ad5-ac64-44bbc01c2d95
    
    0 讨论(0)
  • 2020-12-02 05:50

    Simply write: $heroku login
    It will take you to the web login. Enter your credentials there, and you will be logged in via CLI as well.

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

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

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

    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/
    
    0 讨论(0)
  • 2020-12-02 06:00

    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.

    0 讨论(0)
  • 2020-12-02 06:02

    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/
    
    0 讨论(0)
提交回复
热议问题