Home > development > How to logout of GitHub Copilot in VS2022

How to logout of GitHub Copilot in VS2022

January 13th, 2024

If, like me, you have more than one Github account, (one for work and one private), then you might want to switch accounts when using Visual Studio

My private account does not have CoPilot, so it has a little fit when I try and open visual studio.

Now if you click on the link … it takes me to Github and, it doesn’t matter what I do, my credentials are not changed from my private account to my work account.

The solution is simply to force Github to forget about you

  • Close Visual Studio
  • Probably Close VS Code as well … not sure
  • Go to %localappdata%\github-copilot, (your local app data folder, something like C:\Users\%USERNAME%\AppData\Local\github-copilot)
  • Delete the files hosts.json and versions.json
  • Make sure you are logged in the correct Github account, (with Edge or Chrome or whatever).
  • Restart Visual Studio, you should get logged in auto-magically into your ‘correct’ github account, otherwise you can just login when prompted.

And that’s all, if you are not sure about deleting files you can just rename the folder “github-copilot” to something else, and if things go wrong just rename it back.

If you are not sure or comfortable with deleting, renaming and so on … don’t do it. … you probably should not be developing either in that case, but that’s another problem I guess.

  1. January 9th, 2025 at 11:24 | #1

    Hello, I am reporting an issue on your article “http://www.myoddweb.com/2019/11/09/add-google-test-directly-to-your-visual-studio-project/”.

    I believe users need to delete the default “ConsoleApplication.cpp” in order to use GoogleTest because otherwise there will be two main functions.

    That article is overall pretty useful. I just wanna to check if this is a glitch or I missed something. Feel free to email me!

Comments are closed.