How do I disable Git Credential Manager for Windows?

后端 未结 15 1746
被撕碎了的回忆
被撕碎了的回忆 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:31

    To prevent the dialog use git config --global credential.modalPrompt false, that'll drive the queries to the console.

    0 讨论(0)
  • 2020-11-27 09:32

    OK, I discovered that you need to either avoid checking the "Git Credential Manager" checkbox during the Git for Windows installer, or (after installation) run the Bash shell as Administrator and use git config --edit --system to remove the helper = manager line so that it is no longer registered as a credential helper.

    For bonus points, use git config --edit --global and insert:

    [core]
        askpass =
    

    To disable the OpenSSH credentials popup too.

    0 讨论(0)
  • 2020-11-27 09:32

    and if :wq doesn't work like my case use ctrl+z for abort and quit but these will probably make multiple backup file to work with later – Adeem Jan 19 at 9:14

    Also be sure to run Git as Administrator! Otherwise the file won't be saved (in my case).

    0 讨论(0)
  • 2020-11-27 09:33

    Under "user" folder c://user, look at ".gitconfig" file then remove the http and proxy line.

    0 讨论(0)
  • 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= <command> ...
    

    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 <command> ...
    

    But note that git.exe -c credential.interactive=never <command> ... 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.

    0 讨论(0)
  • 2020-11-27 09:37

    I had had that problem, and I've only removed the git-credential-manager.exe file from:

    C:\Program Files\Git\mingw64\libexec\git-core
    
    0 讨论(0)
提交回复
热议问题