我尝试过:
git config --global core.askpass /usr/lib/git-core/git-gui--askpass
(我使用git-gui--askpass
找到了locate git-gui--askpass
)
但是git gui(在按下时)仍然在终端文本提示符下询问密码。
它仅在一个项目中发生,其他项目显示图形提示。我比较了两者的.git / config和〜/ .gitconfig,没有发现是什么原因导致了这个问题,这很令人困惑……可能是我应该在整个配置过程中做一些更详细的说明,以使其始终有效我猜是吗?
我需要它,因为我总是忘记可能会在终端上询问pw,并长时间等待它显示在对话框中:(
强制将其显示的怪异技巧:
xterm -e "(nohup git gui&disown)&disown;sleep 3"
具有破坏凭证高速缓存的副作用,该凭证高速缓存似乎需要套接字才能工作:
git config --global credential.helper 'cache --timeout=1800'
因此,即使在一分钟后,我也必须再次输入密码:(
项目OK .git / config(最后几节)
[remote "origin"]
url = https://user@somewhere
fetch = +refs/heads/*:refs/remotes/origin/*
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[gui]
wmstate = normal
geometry = 1920x1026+0+24 533 333
烦人的.git / config项目(少了一些部分)
[credential]
helper = cache --timeout=1800
[remote "origin"]
url = ssh://user@somewhere
fetch = +refs/heads/*:refs/remotes/origin/*
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[gui]
wmstate = normal
geometry = 1364x683+-10+14 513 397
〜/ .gitconfig(少部分内容)
[credential]
helper = cache --timeout=1800
[giggle]
main-window-maximized = false
main-window-geometry = 999x698+7+25
main-window-view = HistoryView
show-graph = true
history-view-vpane-position = 238
file-view-vpane-position = 631
[merge]
tool = meld
[diff]
tool = meld
[core]
excludesfile = ~/.gitignore_global
askpass = /usr/lib/git-core/git-gui--askpass
PS .:我正在使用linux