如何使用github令牌或ssh密钥设置Git Bash(msy​​sgit)

pri*_*pri 3 git github

Git新手.

遵循github 帮助页面的所有指示,但是像git pull和git push这样的简单命令会继续在每次调用时提示我的密码.具体来说,我设置如下:

  • git config --global user.name"你的名字"
  • git config --global user.email you@yourdomain.com
  • git config --global github.token 123321321sdssddaqqwq

我还按照帮助中提到的步骤精心设置了ssh密钥,但密码提示不会消失.

建议?

Mar*_*air 8

从您的评论中说,在此提示符下工作的密码是您的GitHub密码,我强烈怀疑您是使用httpsURL而不是SSH URL 克隆了您的存储库.你可以改变它:

 git remote set-url origin git@github.com:whoever/whatever.git
Run Code Online (Sandbox Code Playgroud)

...当您单击存储库页面上的"SSH"按钮时,应该将最后一个参数替换为显示的内容.

(您可以查看origin当前引用的URL git remote -v.)