- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
在使用 git bash 推送远程存储库时,需要并询问我的密码。这不是问题。
问题是我习惯于在 git 控制台中输入密码,但后来我从 Linux 切换到 Windows,我的密码被要求输入提示框而不是控制台。
我发现它不太方便:我必须等待它出现一秒钟,有时我会失去焦点。
奇怪的是,如果我关闭对话框,那么 git 控制台会询问密码。这就是我要找的。
你知道我怎样才能阻止提示框,让我在控制台中输入密码吗?是否有一些我应该修改的 git 选项?
最佳答案
这似乎与git-config 的core.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/
我是一名优秀的程序员,十分优秀!