How do I disable Git Credential Manager for Windows?

后端 未结 15 1837
被撕碎了的回忆
被撕碎了的回忆 2020-11-27 09:29

I notice that in the latest version of Git, the default is now to popup a \"Git Credential Manager for Windows\" dialog instead of prompting me for me password at the Bash p

15条回答
  •  离开以前
    2020-11-27 09:34

    I wanted to use the credential manager for normal use, but I have scripts where I obviously do not want any prompts whatsoever from git.exe. This is how I invoke Git from my scripts:

    set GIT_TERMINAL_PROMPT=0
    git -c core.askpass= -c credential.helper=  ...
    

    This way, the script always sees the "correct" no-prompt setting without having to adapt any configuration.

    (Git for Windows 2.13.3)


    A variation I found that might also come in handy is to set:

    set GCM_INTERACTIVE=never
    # Or: git config --global credential.interactive never
    
    set GIT_TERMINAL_PROMPT=0
    git.exe -c core.askpass= -c credential.helper=manager  ...
    

    But note that git.exe -c credential.interactive=never ... does not work (it seems that the -c thing isn't routed through to Git Credential Manager for Windows or whatever).

    That way, you can use the GCMfW, but it will never prompt you; it will just lookup the credentials, which can be very helpful in non-interactive environs.

提交回复
热议问题