Change Git user in Windows





Problem: How to change Git user in Windows?

Solution:

Step 1: Remove already saved credentials



Go to: Control Panel -> User Accounts -> Manage your credentials -> Windows Credentials

Change Git User in Windows
Windows Credential Manager



Under Generic Credentials, there are some credentials related to Github,
Click on them and click "Remove".

Now you will be asked for new credentials next time.

Reason:

Default installation for Git for Windows set a Git-Credential-Manager-for-Windows.

Either avoid checking "Git Credential Manager" checkbox during the Git for Windows installation

or

You can disable Git-Credential-Manager-for-Windows as follows:

Option 1:

Run Git Bash 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.

Option 2:

Run Git Bash as Administrator and then execute the following command


git config --system --unset credential.helper

Now you will be asked for credentials every time you interact with the remote system.



[Update]
Friday, 11 January 2019

Today I faced the same problem again as i updated the software "Git for windows"
&
I couldn't remove the credentials manager by any means

I ended up using below command explained in this git issue

git config --global credential.github.com.useHttpPath true