Archive

Posts Tagged ‘Copilot’

How to logout of GitHub Copilot in VS2022

January 13th, 2024 No comments

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.