GitHub authentication failing over https, returning wrong email address

前端 未结 8 1447
半阙折子戏
半阙折子戏 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: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".

提交回复
热议问题