如何用github令牌或ssh密钥设置Git Bash(msy​​sgit) [英] How to setup Git Bash (msysgit) with a github token or ssh key

查看:230
本文介绍了如何用github令牌或ssh密钥设置Git Bash(msy​​sgit)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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密钥,但密码提示不会消失。

建议? 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(msy​​sgit)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆