How to remove github login popup asking for credentials?
I changed my Github account recently. I have my new username and email stored in global .gitconfig:
[filter "lfs"]
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
[user]
name = myusername
email = [email protected]
[credential]
helper = store
username = myusername
and my password for github in .git-credentials.
Every time I push to my remote repository Github login pops up asking me for my credentials.
And when I cancel it everything works fine. I don't need to enter username or password. Remote is updated. How to get rid of that popup? I didn't have that behaviour before changing account credentials.
Git has the concept of multiple credential managers. When you installed Git for Windows, it came with the Git Credential Manager for Windows (either the old one or Core), and you probably answered a question about whether you wanted to use it or not.
Somewhere in an earlier config file, such as the system one, there's a setting that looks like credential.helper = manager
. Because Git invokes the credential managers in order and uses the first one that provides it credentials, it first asks the manager
one specified at the system level, causing the pop-up, and then invokes the store
one in your local config file.
What likely happened is that your old account was using the manager
helper but the new one is using the store
helper for saving your password, so the prompt didn't show up for manager
because it had your credentials saved.
If you don't want to the manager
helper, run git config -l --show-origin
to find the file which has the other credential.helper
setting and then edit it to remove that option.
Do note that the manager
helper is going to be more secure than storing your credentials in a file on disk (since it will be encrypted), and it will use a personal access token, which GitHub will require in the future, so you may want to use the popup prompt to get credentials and remove the store
helper instead.
I got this same problem today, got an email from Github that the way I accessed the git has been deprecated, so solved it as below:
-
uninstall the git software ( Or, using
Run > appwiz.cpl
) -
install new git from here - https://git-scm.com/downloads
-
for one time save password - run the below command for this project:
git config --global credential.helper store
-
now run below:
git pull
Note:
-
To run the 3rd & 4th command, you should already be in a git folder (where you ran the
git clone https://github.com/../...git
command) -
This issue occurred because now the GitHub changed it's authentication:
fromgit credential manager
togit credential manager core
See below for more information
Basic authentication using a password to Git is deprecated and will soon no longer work. Visit https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/