如何用github令牌或ssh密钥设置Git Bash(msysgit) [英] How to setup Git Bash (msysgit) with a github token or ssh key
问题描述
遵循github的所有方向帮助页面,但简单的命令,如git pull和git push会继续在每次调用时提示我的密码。具体来说,我设置了以下内容:
我还按照帮助中提到的步骤精心设置了ssh密钥,但密码提示不会消失。
建议?从你的评论中说,在这个提示符下工作的密码是你的GitHub密码,我强烈怀疑你已经克隆了你的存储库使用 https
URL而不是SSH URL。你可以改变它:
git remote set-url origin git@github.com:whoever / whatever.git
...当您单击存储库中的SSH按钮时,应该用所显示的内容替换最后一个参数
(您可以检查当前使用引用的URL
。) origin
> git remote - v
New to Git.
Followed all the directions from github help pages but simple commands like git pull and git push continues to prompt my password on each invocation. Specifically, I set the following:
- git config --global user.name "Your name"
- git config --global user.email you@yourdomain.com
- git config --global github.token 123321321sdssddaqqwq
I also setup ssh keys elaborately as per the steps mentioned in the help but password prompts don't go away.
Suggestions?
From your comment saying that the password that works at this prompt is your GitHub password, I strongly suspect that you've cloned your repository using the https
URL rather than the SSH URL. You can change that with:
git remote set-url origin git@github.com:whoever/whatever.git
... where you should replace the last parameter with whatever's shown when you click the "SSH" button on your repository's page.
(You can check what URL origin
currently refers to with git remote -v
.)
这篇关于如何用github令牌或ssh密钥设置Git Bash(msysgit)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!