Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I change the user on Git Bash?

Tags:

git-bash

enter image description here

I want to sign out an actual user so I can sign in with another user.

What I see in Git bash is:

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 
like image 529
Fre1234 Avatar asked Sep 10 '16 04:09

Fre1234


People also ask

How do I update my git account?

To update your credentials, go to Control Panel -> Credential Manager -> Generic Credentials. Find the credentials related to your git account and edit them to use the updated passwords as per the image below: I hope this helps with your Git issues.


1 Answers

Check what git remote -v returns: the account used to push to an http url is usually embedded into the remote url itself.

https://[email protected]/... 

If that is the case, put an url which will force Git to ask for the account to use when pushing:

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

Or one to use the Fre1234 account:

git remote set-url origin https://[email protected]/<user>/<repo> 

Also check if you installed your Git For Windows with or without a credential helper as in this question.


The OP Fre1234 adds in the comments:

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

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

That is because the default installation for Git for Windows set a Git-Credential-Manager-for-Windows.
See git config --global credential.helper output (it should be manager)

like image 54
VonC Avatar answered Sep 23 '22 11:09

VonC