GitHub authentication failing over https, returning wrong email address

前端 未结 8 1439
半阙折子戏
半阙折子戏 2020-12-07 09:24

Initiating a push or any other action with GitHub from the command line (over https, not ssh) that calls for the username and password not only fails but, when it does, it r

相关标签:
8条回答
  • 2020-12-07 10:07

    [Mac only]

    If you need to delete your authentication, use

    git credential-osxkeychain erase
    host=github.com
    protocol=https
    

    on Mac.

    See https://help.github.com/articles/updating-credentials-from-the-osx-keychain/

    0 讨论(0)
  • 2020-12-07 10:09
    • Go to Credential Manager => Windows Manager
    • Delete everything related to tfs
    • Now click on Add a generic credential and provide the following values

      (1) Internet or network adress: git:https://tfs.donamain name (2) username: your username (3) password: your password

      this should fix it

    0 讨论(0)
  • 2020-12-07 10:10

    I do not have an @github.com address

    You don't have to: the @ is the separator between the username:password and the domain.
    It is not an email address.

    A full GitHub https url would be:

    https://username:password@github.com/username/reponame.git
    

    Without the password (which would then be asked on the command line), that would gave:

    https://username@github.com/username/reponame.git
    

    But again, username@github.com isn't an email address, just the first part of the credentials.

    Make sure the case of your username and reponame is correct: it is case sensitive.

    Note that you can store and encrypt your credentials in a .netrc.gpg (or _netrc.gpg on Windows) if you don't want to put said credentials in clear in the url.
    See "Is there a way to skip password typing when using https://github".

    0 讨论(0)
  • 2020-12-07 10:11

    It may happen in Windows if you stored a different credentials before. Go to Credential Manager and delete stored github credentials

    0 讨论(0)
  • 2020-12-07 10:12

    On Windows, you may be silently blocked by your Antivirus or Windows firewall. Temporarily turn off those services and push/pull from remote origin.

    0 讨论(0)
  • 2020-12-07 10:18

    GitHub's support determined the root of the issue right away: Two-factor authorization.

    To use GitHub over the shell with https, create an OAuth token. As the page notes, I did have to remove my username and password credentials from Keychain but with osx-keychain in place, the token is stored as the password and things work exactly as they would over https without two-factor authorization in place.

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