How to skip, ignore and/or reject git credentials prompts
The answers above only worked partly for me when using Git-for-Windows: two different applications there were vying for my attention from the automated git pull/push scripts:
- git-credentials-manager (developed by the GfW team AFAICT; has a clean, grey Windows interface look)
- another dialog, which' ancestry has some definitely (crappy looking) X-Windows genes.
To shut all of them up, without uninstalling the credentials manager as mentioned in some answers here: https://stackoverflow.com/questions/37182847/how-do-i-disable-git-credential-manager-for-windows, here's what now works, sitting on top of the automated (bash
) shell scripts:
# https://serverfault.com/questions/544156/git-clone-fail-instead-of-prompting-for-credentials
export GIT_TERMINAL_PROMPT=0
# next env var doesn't help...
export GIT_SSH_COMMAND='ssh -oBatchMode=yes'
# these should shut up git asking, but only partly: the X-windows-like dialog doesn't pop up no more, but ...
export GIT_ASKPASS=echo
export SSH_ASKPASS=echo
# We needed to find *THIS* to shut up the bloody git-for-windows credential manager:
# https://stackoverflow.com/questions/37182847/how-do-i-disable-git-credential-manager-for-windows#answer-45513654
export GCM_INTERACTIVE=never
What did NOT work
- All the incantations of
git config credential.modalprompt false
-- mentioned as a solution in answers to that linked SO question. no dice for me.
- fiddling with that
GIT_SSH_COMMAND
environment variable: nothing worked but keeping it as I suspect it'll kick in when running this stuff on a Linux box instead of Windows.
GIT_TERMINAL_PROMPT=0
: no worky either. Kept it in for the same reason, but no dice on Windows.
Oh, and uninstalling the git credentials manager as suggested in other answers in that SO link was decided a no go option as it would definitely impact other repository trees where this thing may be useful one day. Though it was considered for a bit, before I decided against doing this.
What DID work
My git version
$ git --version
git version 2.30.1.windows.1
Parting note
<rant>
Been looking for this info on-and-off for years: this time apparently I was lucky and maybe persevered longer(?), wading through the zillion pages yakking about setting up your credentials: google clearly is not intelligent. At least it does not listen very well to minority questions, that's for sure. </rant>
The title is added in hopes that google indexing places this page higher for the next one looking for answers to these questions or variations therefor...