Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing the Git user inside Visual Studio Code

The user for my Git commits has changed, but I am not able to change that inside of Visual Studio Code.

I changed the global settings in Git, but when I want to push or sync via Visual Studio Code inside my new repositories I get the error that the oldusername has not the permission to push into newrepository.

At this point it is not the permission. The change of the username did not work for Visual Studio Code. When I use the terminal I can push. It is also not a solution to allow the olduser to push to the newrepository.

I am on Windows 10. So all other tools are working, but just at Visual Studio Code I was not able to change the user.

How can I fix this problem?

like image 834
apxp Avatar asked Feb 18 '17 17:02

apxp


People also ask

How do I change my GitHub account in Visual Studio?

If you need to access resources from a different account, you'll need to remove any existing GitHub account from Visual Studio, sign out from the web (GitHub.com), and then restart the process for adding the new GitHub account to Visual Studio.

How do I switch from one user to another in Git?

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".

How do I unlink my GitHub account from Visual Studio?

A: Go to the Security tab of account.microsoft.com and select Advanced security options to unlink your GitHub account. Unlinking your GitHub account removes it as a sign-in method and removes access to any GitHub repositories in Visual Studio.


2 Answers

I resolved this issue by setting an email address in Git:

git config --global user.email "[email protected]" 
like image 128
Gregory Thomas Avatar answered Sep 30 '22 07:09

Gregory Thomas


Generally, Visual Studio Code uses the GitHub credentials from the system's credential manager. It doesn't store it anywhere in the settings. As question says, Changing the Git user inside Visual Studio Code, is not inside rather outside.

Search for or go to Credential Manager (Windows control panel) → Windows Credentials → update the GitHub password from the list.

like image 25
Ram Avatar answered Sep 30 '22 06:09

Ram