While pushing on a remote repository using git bash, my password is required and asked. This is not a problem.
The issue is that I was used to just type my password into the git console, but then I switched from Linux to Windows and my password is asked into a prompt box instead of the console.
I find it much less convenient: I have to wait for one second that it appears and sometimes I lose the focus.
What is strange is that if I close the dialog box, then the password is asked from within the git console. This is what I am looking for.
Do you know how could I prevent the box to be prompted and just let me type my password into the console, please? Is there some git option I should modify?
You can avoid being prompted for your password by configuring Git to cache your credentials for you. Once you've configured credential caching, Git automatically uses your cached personal access token when you pull or push a repository using HTTPS.
If Git prompts you for a username and password every time you try to interact with GitHub, you're probably using the HTTPS clone URL for your repository.
This seems to be related with the core.askPass
option of git-config.
The documentation says:
core.askPass
Some commands (e.g. svn and http interfaces) that interactively ask for a password can be told to use an external program given via the value of this variable. Can be overridden by the GIT_ASKPASS environment variable. If not set, fall back to the value of the SSH_ASKPASS environment variable or, failing that, a simple password prompt. The external program shall be given a suitable prompt as command-line argument and write the password on its STDOUT.
My default configuration contains nothing about this option, so I guess it fall back to the "simple password prompt".
To override this behavior, I just had to set the option to an empty string:
git config --global core.askPass ''
Then, the password is asked from the console without prompting anything.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With