简体   繁体   English

Windows上的Git凭据帮助器,无需输入凭据

[英]Git Credential Helper on Windows without asking for credentials

Is there a way to run the Git Credential helper on Windows without asking for username/password if there is no stored information? 如果没有存储的信息,是否可以在Windows上运行Git凭据帮助程序而无需询问用户名/密码?

The git credential command provides the fill command, allowing to retrieve credentials for a Git repo. git credential命令提供fill命令,允许检索Git存储库的凭据。 If there is stored credential information, it prints it to stdout . 如果存储了凭证信息,则将其打印到stdout

If there is no stored information for the requested repo, it opens a prompt or Windows dialog to ask for the credentials. 如果没有用于请求的存储库的已存储信息,它将打开提示或Windows对话框,要求提供凭据。 Can this be avoided? 可以避免吗?

To replicate: 复制:

url=http://foo [ENTER] [ENTER]

Make sure to end with two blank lines to tell the credential helper that your input is finished. 确保以两个空行结束,以告知凭据帮助者您的输入已完成。

Since the Git credential helper shouldn't have any stored information for this repo, it will prompt you for your credentials. 由于Git凭证帮助程序不应该为此回购存储任何信息,因此它将提示您输入凭证。 On Windows, this is done using a system credential dialog (similar to the login dialog). 在Windows上,这是使用系统凭据对话框(类似于登录对话框)完成的。

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. 似乎没有办法避免提示输入凭据。

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 . 我通常基于gpg加密的.netrc (或Windows上的_netrc )和官方的contrib/credential/netrc/test.netrc perl脚本使用不同的凭据帮助器,对此我做了一些修改
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. 这样,我只需要在会话期间输入一个密码,并且存储在加密的.netrc中的所有不同凭据就可用于所有站点。

Since there is a gpg agent running, I don't have to enter that same password during the current session. 由于有一个gpg代理正在运行,因此我在当前会话期间不必输入相同的密码。

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

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凭证帮助程序都应遵守' get '命令,因此请检查git-credential-winstore命令是否可以使用类似的命令。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 自定义 git 凭证助手无法在 windows 上进行身份验证 - Custom git credential helper fails to authenticate on windows Windows服务安装程序,无需输入凭据 - Installer for windows service without asking for credentials Jenkins无法从Windows凭据管理器检测到GIT凭据 - Jenkins does not detect GIT credentials from Windows Credential manager 如何在 Windows 的 Git Credential Manager 中的每个 repo 本地存储凭据? - How to store credentials locally per repo in Git Credential Manager for Windows? TFS Git存储库不断要求Windows命令提示符上的凭据 - TFS Git repository asking constantly for credentials on Windows Command Prompt 使用 Java 中的 windows 凭据管理器获取凭据,用于身份验证进入 git 和其他服务 - Use the windows credential manager in Java to get credentials for authentication into git and other services 如果其他所有操作失败,则Windows的Git似乎会自动退回到凭证助手“ manager”。 我该如何预防? - Git for windows seems to automatically fall back to credential helper “manager” if everything else fails. How do I prevent this? Git LFS 不考虑 credential.helper 的配置文件级别 - Git LFS does not respect level of config files for credential.helper 在Windows中更改git挂接凭据 - Change git hook credentials in Windows 如何在不考虑缓存域凭据的情况下验证域凭据 - How to validate domain credentials without considering the Cached Domain Credential
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM