search

Home  >  Q&A  >  body text

GitHub提示需要用户名

SSH key设置没问题,之前也一直用的没问题。

从最近的某天开始会提示:

$ git push
Username for 'https://github.com':

ssh -T git@github.com

也是能正常返回GitHub用户名的。

黄舟黄舟2772 days ago697

reply all(2)I'll reply

  • 为情所困

    为情所困2017-04-28 09:07:29

    You are using https protocol
    And ssh -T git@github.com is obviously the ssh protocol

    Change the git address to ssh protocol

    reply
    0
  • phpcn_u1582

    phpcn_u15822017-04-28 09:07:29

    git remote remove origin
    #remove

    git remote add origin git@github.com:Username/Your_Repo_Name.git
    #changessh

    git push --set-upstream
    #I can’t remember the last command clearly. Anyway, enter git push first, and then there will be a prompt. Just enter it as prompted.

    reply
    0
  • Cancelreply