Search code examples
githubvisual-studio-code

How to remove the Visual Studio Code cloud settings from Github?


I completely removed Visual Studio Code from one of my machines because I wanted to reset all the settings. After reinstalling it and turning on the settings sync ( I'm using Github, not Microsoft ) VSC asked me how to sync the local settings with the cloud settings. I could either

  • merge the settings
  • replace my local settings with the cloud settings

Unfortunately I wasn't able to find the option replace cloud settings with local settings. I tried to remove GitHub for VS Code from Authorized OAuth Apps but that didn't help. How can I remove the cloud settings from Github?


Solution

  • When you connect Visual Studio Code to your GitHub account :
    Turn on Settings Sync... -> Sign in & Turn on -> Sign in with GitHub
    you supposed to see a little pop-up at the middle of your VSCode that ask you how you want sync :
    Merge Manually | Replace Local | Merge

    If unfortunately you synchronized and replace your local config, you can't remove the cloud settings from Github but you can access to the SYNC ACTIVITY history :
    (min version 1.58)
    Ctrl + Shift + P -> Settings Sync: Show Synced Data
    The SYNC ACTIVITY menu contains all the changes that the synchronization did for each config types. You can tick the sync types after selecting Turn on Settings Sync... :

    • Settings : user interface, font size, preferences...
    • Keyboard Shortcuts
    • User snippets
    • User tasks : automate tasks like building, packaging, testing...
    • Extensions
    • UI State : history of display Languages, activity Bar entries, recently used commands...

    In the SYNC ACTIVITY menu each type is organized by a specific synchronization, if you select a config file you will see all the changes from your previous config (left) to the new (right). You just have to find all the configuration files for the specific time you did the synchronization. Select the left tab to save it in place of the current config file in your configuration folders:

    User settings location :

    • Windows: %APPDATA%\Code\User
    • macOS: $HOME/Library/Application\ Support/Code/User
    • Linux: $HOME/.config/Code/User

    Workspace settings location :

    • Windows : %USERPROFILE%\.vscode
    • macOS : ~/.vscode
    • Linux : ~/.vscode

    Files location :

    • Settings : <user-settings>\Code\User\ settings.json

    • Keyboard Shortcuts : <user-settings>\Code\User\ keybindings.json

    • User snippets : <user-settings>\Code\User\snippets\ <language-name>.json

    • User tasks : <user-settings>\Code\User\ tasks.json

    • Extensions : <workspace-settings>\ extensions.json

    • UI State : <user-settings>\Code\User\globalStorage\ state.vscdb
      (vscdb file is a SQLite database, tool like sqlitebrowser is required)

    Do it for all the setting files that you need to restore and that should work.
    If you have any extra extensions you just need to remove them from your VSCode.