Git(1.7.10)每次都询问我的用户名和密码 [英] Git (1.7.10) asks me every time for username and password

查看:167
本文介绍了Git(1.7.10)每次都询问我的用户名和密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



现在直接询问github用户名和密码当我每次推动。



这是git的一项新功能,或者在过去改变了它,或者有什么改变了github?



我尝试使用ssh进行身份验证,并使用我的ssh密钥文件中的电子邮件和密码进行身份验证,并且它能正常工作。



GitHub更改为smartftp,并且也更改了设置回购的指示

https://github.com/blog/1104-credential-caching-for-wrist-friendly-git-usage



https://help.github.com/articles/create-a-repo



之后看到它们,默认情况下它们现在使用https而不是git协议

解方案

我就遇到了这个前些天切割和粘贴时从GitHub上新的存储库的指令。有人应该提交错误报告,因为它会让我认识的几乎每个人都感到困惑。



问题是,这些说明会告诉您创建使用https协议的远程服务器比git协议。我通常使用:

  github_username = CodeGnome 
git remote add origingit@github.com:$ {github_username} /${PWD##*/}.git
git push --tags --set-upstream origin master

从一个预先存在的本地存储库中填充一个新的GitHub存储库。


Since I have the new version it doesnt ask me anymore for the password I set in my ssh key file.

It asks now directly for a github username and password when I push every time.

Is this a new feature of git or changed it in the past or is there something which changed on github?

I tried to authenticate using ssh and the email and password from my ssh key file and it worked.

GitHub changed to smartftp and also changed the instructions for setting up repos

https://github.com/blog/1104-credential-caching-for-wrist-friendly-git-usage

https://help.github.com/articles/create-a-repo

Saw it later, they use now https instead of the git protocol by default

解决方案

I ran into this the other day when cutting-and-pasting from the new repository instructions on GitHub. Someone should probably file a bug report, because it confuses almost everyone I know.

The issue is that the instructions tell you to create a remote that uses the https protocol, rather than the git protocol. I typically use:

github_username=CodeGnome
git remote add origin "git@github.com:${github_username}/${PWD##*/}.git"
git push --tags --set-upstream origin master

to populate a new GitHub repository from a pre-existing local one.

这篇关于Git(1.7.10)每次都询问我的用户名和密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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