gpt4 book ai didi

windows - 有没有办法让git在windows上打开密码提示框?

转载 作者:可可西里 更新时间:2023-11-01 09:52:27 26 4
gpt4 key购买 nike

在使用 git bash 推送远程存储库时,需要并询问我的密码。这不是问题。

问题是我习惯于在 git 控制台中输入密码,但后来我从 Linux 切换到 Windows,我的密码被要求输入提示框而不是控制台。

Prompt box for password

我发现它不太方便:我必须等待它出现一秒钟,有时我会失去焦点。

奇怪的是,如果我关闭对话框,那么 git 控制台会询问密码。这就是我要找的。

What I am looking for

你知道我怎样才能阻止提示框,让我在控制台中输入密码吗?是否有一些我应该修改的 git 选项?

最佳答案

这似乎与git-configcore.askPass 选项有关。 .

文档说:

core.askPass
Some commands (e.g. svn and http interfaces) that interactively ask for a password can be told to use an external program given via the value of this variable. Can be overridden by the GIT_ASKPASS environment variable. If not set, fall back to the value of the SSH_ASKPASS environment variable or, failing that, a simple password prompt. The external program shall be given a suitable prompt as command-line argument and write the password on its STDOUT.


我的默认配置不包含有关此选项的任何内容,所以我猜它会退回到“简单密码提示”。

要覆盖此行为,我只需将选项设置为空字符串即可:

git config --global core.askPass ''

然后,在没有任何提示的情况下从控制台询问密码。

关于windows - 有没有办法让git在windows上打开密码提示框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34906389/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com