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?
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.
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".
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.
I resolved this issue by setting an email address in Git:
git config --global user.email "[email protected]"
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With