Git Windows Disable password prompt UI but get password prompt from shell

后端 未结 5 722
深忆病人
深忆病人 2021-01-31 09:50

In git bash for windows, the username and/or password is asked in a separate UI popup prompt like below.

On Hitting Cancel you get the below shell based prompt

5条回答
  •  粉色の甜心
    2021-01-31 10:23

    Unset SSH_ASKPASS.

    unset SSH_ASKPASS
    

    To do this automatically each time you open git bash, you can add the above line to the end of your .bashrc.

    Investigation

    The gitcredentials docs linked in other answers list a number of places git will check to determine how to ask for a password. I investigated each in turn:

    env | grep GIT
    git config --get core.askPass
    env | grep SSH
    

    The last command told me SSH_ASKPASS existed:

    SSH_ASKPASS=/mingw64/libexec/git-core/git-gui--askpass`.
    

    This is not part of my dotfiles, and so seems to come from the default Windows git distribution from http://git-scm.com.

提交回复
热议问题