git:强制用户和密码提示 [英] git: force user and password prompt

查看:121
本文介绍了git:强制用户和密码提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近从 1.8.0.1 。> $ b更新了本地git安装到 1.8.1 $ b我注意到,当我在github上工作时,它不会提示我输入用户名和密码。

这让我很烦恼,因为我认为每次都必须输入用户名和密码作为一项很好的安全措施。 (如果其他人使用我的电脑?)



我检查了以下内容:


  • 1.8.0.1 在另一台计算机上仍然要求输入用户名和密码。

  • 我的github帐户仍然强制执行私人/安全控制。

  • 我使用的是https远程引用,而不是ssh。
  • 为了更好的衡量,我检查了〜/。 ssh fonder。
  • < proj> /。git / config files。
  • 我也是不是〜/ .netrc

  • 中创建了一个新的虚拟档案库:仍然不会提示我进行登录。 li>


在git中找不到任何东西发行说明档案

有谁知道这是否是一种新的git行为?如何恢复提示?

Cheers

解决方案


c $ c> git config -l <​​/ code>,我现在看到我有一个 credential.helper = osxkeychain 选项


这意味着 凭证助手 (最初在1.7.10中引入)现已生效,并且会自动缓存通过HTTP访问远程仓库的密码。

(如 GIT:设置默认登录凭据的任何方式?



您可以完全禁用该选项,或者仅针对单个回购


I recently updated my local git installation to 1.8.1 from 1.8.0.1.
I'm noticing that, when I work on github, it doesn't prompt me for username and password on push anymore.

This troubles me, as I see having to type user and password every time as a good security measure. (what if someone else uses my computer?)

I checked the following:

  • 1.8.0.1 on another computer still asks for username and password.
  • my account on github still enforces private/security controls.
  • I am using https remote references, rather than ssh.
  • For good measure, I checked in my ~/.ssh fonder. Nothing wrong there.
  • I'm not storing the login details in ~/.gitconfig or individual <proj>/.git/config files.
  • I'm also not storing anything github-related in ~/.netrc.
  • I created a new dummy archive: still doesn't prompt me for login.

I couldn't find anything in the git release notes archive.

Does anyone know if this is a new git behaviour? How do I restore the prompt?
Cheers

解决方案

With git config -l, I now see I have a credential.helper=osxkeychain option

That means the credential helper (initially introduced in 1.7.10) is now in effect, and will cache automatically the password for accessing a remote repository over HTTP.
(as in "GIT: Any way to set default login credentials?")

You can disable that option entirely, or only for a single repo.

这篇关于git:强制用户和密码提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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