28

Been playing around with this Microsoft Editor. Quite good, but some of the most basic UI bits are missing.

Can't figure out how to unlink / sign out from the Git repo I signed in before. Quitting and reopening the software doesn't work and - useless to say - I have many repo I work with.

Any idea?

Andrea Moro
  • 676
  • 2
  • 9
  • 20
  • Sign out from git repo? – LiverpoolOwen Mar 12 '17 at 19:58
  • 1
    Not sure whether this is a question as mine is awkward. Probably it is. But by the time you connect Git within Visual Studio Code, that login details are remembered forever apparently. Can't "unlink" and everything I do, every file is potentially committable to the original git repository I decided to connect for the first time. – Andrea Moro Mar 12 '17 at 20:06
  • If you want to ignore files then you can use the .gitignore file. Git repos are always active anyway. Visual studio code just plugs into its API. If you want to not see the git status I guess you could always open the solution at a different folder level like the one above as it won't recognise the git repo but I don't see the point, unless i am missing something? – LiverpoolOwen Mar 12 '17 at 22:29
  • Ok, the problem was with the concept of "folder" rather than "project". – Andrea Moro Mar 13 '17 at 00:28

10 Answers10

47

On the bottom of the side panel, there is an account icon (usually its sitting right above the cog icon).

enter image description here

Click on it, click on your user name, and choose "log out".

Suragch
  • 484,302
  • 314
  • 1,365
  • 1,393
joernalctl
  • 471
  • 4
  • 2
6

To stop VSC from trying to link to the Git repo, in VSC: File -> Preferences -> Settings, paste this into the settings.json:

"git.enabled": false
SVUser
  • 367
  • 3
  • 9
6

Go to settings

search for 'git'

uncheck the git : Github Authentification

vs code will ask you your user and password the next time you commit somthing

screenshot

151 Yek
  • 85
  • 1
  • 6
  • This worked for me. For some reason you have to disable the Automatic Github Authentication, then it will ask you for you username and password again with the next pull or push. After that you can enable the Automatic Github Authentication again. – Terrabythia Jan 21 '21 at 13:12
5

It is quite simple once you see it. Check the left bottom of the VSCode and there should be a user icon that will allow you to sign out. If you want to sign in, just try git pull command and it will ask you to re-authorize again.

enter image description here

Sangram Nandkhile
  • 17,634
  • 19
  • 82
  • 116
4

I found it in GitHub settings under https://github.com/settings/applications

But since I had two laptops with two versions of Visual Studio configured to access GitHub account, there was only one token to be removed as "GitHub Extension for Visual Studio", it seems that it is not possible "yet" to remove access permission for specific machine.

LazZiya
  • 5,286
  • 2
  • 24
  • 37
3

Below Solution worked for me hope this will work for someone

GithubSite -> Login -> Settings -> Developer Settings -> Personal Access Token -> Delete (Token For that PC Name) -> click Agree (I Understand, delete this token)

Or

Click below (with credentials if you are not logged in)

https://github.com/settings/tokens

and delete token (For that PC Name)

Navjyot
  • 118
  • 1
  • 11
3

In the top right corner of visual studio, you see the icon of your microsoft account. Click on it and choose Account Settings. A windows will open then in which you will be able to remove your github account.

Tun Kapgen
  • 81
  • 3
1

Ok, the problem was with the concept of "folder" rather than "project". Visual Studio Code consider the folder (hence the Git) open until the folder is not intentionally closed from the file menu.

Andrea Moro
  • 676
  • 2
  • 9
  • 20
1

This solution here worked for me super easy account logout from team explorer git

Close all Visual Studio instances, delete %LOCALAPPDATA%.IdentityService as you did.

Clear TFS caches %LOCALAPPDATA%\Microsoft\Team Foundation\7.0\Cache

Restart Visual Studio > Team Explorer > Manage Connections to check if the Enter credential dialog popup.

Community
  • 1
  • 1
Adel Mourad
  • 1,351
  • 16
  • 13
1

For those suffering from the "no account icon at the bottom left of VS Code" if you right click the source control icon and check "Accounts" it will show the icon back where it should be. See screenshot below.

VS Code Screenshot

Conor
  • 49
  • 7