How to change user on git bash?

enter image description here

I want to release the actual user so that I can log in with another user.

What I see in Git bash:

MINGW64 ~/Documents/NetBeansProjects/ConstructorJava (master) git push -u origin/master remote: Permission to Fre1234/ConstructorJava.git denied to Fre123. Fatal: unable to access https://github.com/Fre1234/ConstructorJava.git/": The requested URL returned error: 403 
+19
source share
3 answers

Check what git remote -v returns: the account used to click on the http url is usually injected into the remote url.

 https:// Fre123@github.com /... 

If so, put a URL that will prompt Git to ask the account to use when clicked:

 git remote set-url origin https://github.com/<user>/<repo> 

Or use your Fre1234 account:

 git remote set-url origin https:// Fre1234@github.com /<user>/<repo> 

Also check if you installed Git for Windows with or without a credential assistant like in this question .


OP Fre1234 adds in the comments :

I finally found a solution.
Go to: Control Panel -> User Accounts -> Manage your credentials -> Windows Credentials

There are some credentials associated with Github in the Generic Credentials ,
Click on them and click " Remove ."

This is because the default installation for Git for Windows installs Git-Credential-Manager-for-Windows .
See git config --global credential.helper (it must be manager )

+55
source

For Mac Users

I am using a Mac and faced the same problem when trying to submit a project from Android Studio. The reason another user previously logged in to Github and their credentials were stored in Keychain Access.

You need to remove these credentials from Keychain Access, and then try to click.

Hope this helps Mac users.

+4
source

For Mac Users

I am using a Mac and I encountered the same problem when trying to push a project from Android Studio. The reason is that another user previously logged into GitHub and his credentials were saved in Keychain Access.

The solution is to delete the entire information store in the keychain for this process

enter image description here

0
source

All Articles