Removing a GitHub account from Visual Studio Code

Hey everyone,

I’m stuck with a problem in VS Code. I’ve got an old GitHub account linked to it, but I can’t use that account anymore. Now I need to get rid of it completely.

Does anyone know how to unlink a GitHub account from VS Code? I’m on Ubuntu, if that makes any difference.

I’ve looked through the settings, but I can’t find anything obvious. It’s really bugging me because I want to connect my new account, but this old one is in the way.

Any help would be awesome. Thanks!

hey mate, i had the same issue. try this: go to view > command palette (or ctrl+shift+p), type ‘github sign out’, hit enter. should do the trick. if not, check ur credentials helper in git config. good luck!

I encountered a similar situation recently. I closed VS Code and then navigated to the settings folder (typically located at ~/.config/Code/User/ on Ubuntu). Opening the settings.json file in a text editor, I searched for any GitHub-related entries and removed them. After saving the file and restarting VS Code, the old GitHub account was no longer linked. This allowed me to set up the new account using the usual GitHub integration process. Clearing the Git credentials cache system-wide can also help if the issue persists.

I’ve been through this frustration before. What worked for me was clearing out the GitHub authentication tokens. Open a terminal and run ‘git credential-manager uninstall’, then ‘git credential-manager install’. This wipes the slate clean.

After that, restart VS Code and you should be prompted to sign in again. If not, try the Command Palette method Bob mentioned.

One thing to watch out for - make sure you’ve pushed all your changes before doing this. I lost some work once because I forgot to sync up first.

If all else fails, you might need to reinstall VS Code. It’s a pain, but sometimes it’s the only way to fully reset things.