Git的凭据助手在Windows上不要求凭证 [英] Git Credential Helper on Windows without asking for credentials

查看:1514
本文介绍了Git的凭据助手在Windows上不要求凭证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在Windows上运行的Git凭据助手不要求用户名/密码,如果没有存储的信息?

Is there a way to run the Git Credential helper on Windows without asking for username/password if there is no stored information?

git的凭证命令提供了填写命令,允许检索一个Git回购凭证。如果有存储的凭据信息,因此其打印到标准输出

The git credential command provides the fill command, allowing to retrieve credentials for a Git repo. If there is stored credential information, it prints it to stdout.

如果有请求的回购没有存储的信息,它会打开一个提示或Windows对话框要求输入凭据。这能避免?

If there is no stored information for the requested repo, it opens a prompt or Windows dialog to ask for the credentials. Can this be avoided?

要复制:

  • Install the Windows credential helper from https://gitcredentialstore.codeplex.com/
  • Run git credential fill and then enter the following in the command window:

URL = HTTP:// foo的[设置]
[输入]

请确保用两个空行结束,告诉你输入完成凭证帮手。

Make sure to end with two blank lines to tell the credential helper that your input is finished.

由于Git的凭据助手不应该有这个回购协议的任何存储的信息,它会提示您输入凭据。在Windows中,这是使用系统凭据对话框(类似于登录对话框)来完成。

Since the Git credential helper shouldn't have any stored information for this repo, it will prompt you for your credentials. On Windows, this is done using a system credential dialog (similar to the login dialog).

有没有办法避免这种提示?我正在寻找的是类似回报code,表明有请求的回购没有存储的信息。目前,这似乎并不可能,凭证助手总是要求凭据。

Is there a way to avoid this prompt? What I'm looking for is something like a return code indicating that there was no stored information for the requested repo. At the moment, this doesn't seem to be possible, the credential helper always asks for the credentials.

推荐答案

似乎没有办法避免的提示凭据。

There doesn't seem a way to avoid that prompt for credentials.

我通常使用不同的凭据帮手,根据的GPG加密的.netrc (或 _netrc 在Windows上)和官方的 的contrib /凭证/ NETRC / test.netrc perl脚本,其中的我修改了一下。结果
这样的话,我只需要输入的有一个的会议期间密码和的所有的存储在不同的证书加密的.netrc 适用于所有的部位。

I usually use a different credential helper, based on an gpg-encrypted .netrc (or _netrc on Windows) and the official contrib/credential/netrc/test.netrc perl script, which I modify a bit.
That way, I only have to enter one password during the session, and all the different credentials stored in the encrypted .netrc are available for all the site.

既然有GPG代理上运行,我没有在本届会议期间输入相同的密码。

Since there is a gpg agent running, I don't have to enter that same password during the current session.

我用同样的脚本来检查,如果一个网站有凭据信息或不符合:

I use that same script to check if a site has credential information or not with:

echo host=a.site.com | ./git-credential-netrc -f path/to/.netrc.asc get

GET 命令应该由任何混帐凭证帮手得到尊重,因此,检查是否有类似的命令将与混帐凭据winstore工作命令。

The 'get' command should be respected by any git credential helper, so check if a similar command would work with git-credential-winstore command.

这篇关于Git的凭据助手在Windows上不要求凭证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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