Remove credentials from Git
Solution 1:
If this problem comes on a Windows machine, do the following.
-
Go to Credential Manager
- in German, it is called: Anmeldeinformationsverwaltung
- in French, it is called: Gestionnaire d'identification
- in Polish, it is called: Menedżer poświadczeń
- in Portuguese, it is called: Gerenciador de Credenciais
- in Russian, it is called: Диспетчер учётных данных
- in Spanish, it is called: Administrador de credenciales
-
Go to Windows Credentials
-
Delete the entries under Generic Credentials
-
Try connecting again. This time, it should prompt you for the correct username and password.
Solution 2:
The Git credential cache runs a daemon process which caches your credentials in memory and hands them out on demand. So killing your git-credential-cache--daemon process throws all these away and results in re-prompting you for your password if you continue to use this as the cache.helper option.
You could also disable use of the Git credential cache using git config --global --unset credential.helper
. Then reset this, and you would continue to have the cached credentials available for other repositories (if any). You may also need to do git config --system --unset credential.helper
if this has been set in the system configuration file (for example, Git for Windows 2).
On Windows you might be better off using the manager helper (git config --global credential.helper manager
). This stores your credentials in the Windows credential store which has a Control Panel interface where you can delete or edit your stored credentials. With this store, your details are secured by your Windows login and can persist over multiple sessions. The manager helper included in Git for Windows 2.x has replaced the earlier wincred helper that was added in Git for Windows 1.8.1.1. A similar helper called winstore is also available online and was used with GitExtensions as it offers a more GUI driven interface. The manager helper offers the same GUI interface as winstore.
Extract from the Windows 10 support page detailing the Windows credential manager:
To open Credential Manager, type "credential manager" in the search box on the taskbar and select Credential Manager Control panel.
And then select Windows Credentials to edit (=remove or modify) the stored git credentials for a given URL.