Settings Sync in Visual Studio Code (2024)

Settings Sync lets you share your Visual Studio Code configurations such as settings, keybindings, and installed extensions across your machines so you are always working with your favorite setup.

Turning on Settings Sync

You can turn on Settings Sync using the Turn On Settings Sync... entry in the Manage gear menu at the bottom of the Activity Bar.

Settings Sync in Visual Studio Code (1)

You will be asked to sign in and what preferences you would like to sync; currently Settings, Keyboard Shortcuts, Extensions, User Snippets, and UI State are supported.

Settings Sync in Visual Studio Code (2)

Selecting the Sign in & Turn on button will ask you to choose between signing in with your Microsoft or GitHub account.

Settings Sync in Visual Studio Code (3)

After making this selection, the browser will open so that you can sign in to your Microsoft or GitHub account. When a Microsoft account is chosen, you can use either personal accounts, such as Outlook accounts, or Azure accounts, and you can also link a GitHub account to a new or existing Microsoft account.

After signing in, Settings Sync will be turned on and continue to synchronize your preferences automatically in the background.

Merge or Replace

If you already synced from a machine and turning on sync from another machine, you will be shown with following Merge or Replace dialog.

Settings Sync in Visual Studio Code (4)

  • Merge: Selecting this option will merge local settings with remote settings from the cloud.
  • Replace Local: Selecting this option will overwrite local settings with remote settings from the cloud.
  • Merge Manually...: Selecting this option will open Merges view where you can merge preferences one by one.

Settings Sync in Visual Studio Code (5)

Configuring synced data

Machine settings (with machine or machine-overridable scopes) are not synchronized by default, since their values are specific to a given machine. You can also add or remove settings you want to this list from the Settings editor or using the setting settingsSync.ignoredSettings.

Settings Sync in Visual Studio Code (6)

Keyboard Shortcuts are synchronized per platform by default. If your keyboard shortcuts are platform-agnostic, you can synchronize them across platforms by disabling the setting settingsSync.keybindingsPerPlatform.

All built-in and installed extensions are synchronized along with their global enablement state. You can skip synchronizing an extension, either from the Extensions view (⇧⌘X (Windows, Linux Ctrl+Shift+X)) or using the setting settingsSync.ignoredExtensions.

Settings Sync in Visual Studio Code (7)

Following UI State is synchronized currently:

  • Display Language
  • Activity Bar entries
  • Panel entries
  • Views layout and visibility
  • Recently used commands
  • Do not show again notifications

You can always change what is synced via the Settings Sync: Configure command or by opening the Manage gear menu, selecting Settings Sync is On, and then Settings Sync: Configure.

Conflicts

When synchronizing settings between multiple machines, there may occasionally be conflicts. Conflicts can happen when first setting up sync between machines or when settings change while a machine is offline. When conflicts occur, you will be presented with the following options:

  • Accept Local: Selecting this option will overwrite remote settings in the cloud with your local settings.
  • Accept Remote: Selecting this option will overwrite local settings with remote settings from the cloud.
  • Show Conflicts: Selecting this will display a diff editor similar to the Source Control diff editor, where you can preview the local and remote settings and choose to either accept local or remote or manually resolve the changes in your local settings file and then accept the local file.

Switching Accounts

If at any time you want to sync your data to a different account, you can turn off and turn on Settings Sync again with different account.

Syncing Stable versus Insiders

By default, the VS Code Stable and Insiders builds use different Settings Sync services, and therefore do not share settings. You can sync your Insiders with Stable by selecting the Stable sync service while turning on Settings Sync. This option is only available in VS Code Insiders.

Settings Sync in Visual Studio Code (8)

Note: Since Insiders builds are newer than Stable builds, syncing them can sometimes lead to data incompatibility. In such cases, Settings sync will be disabled automatically on stable to prevent data inconsistencies. Once newer version of Stable build is released, you can upgrade your stable client and turn on sync to continue syncing.

Restoring data

VS Code always stores local and remote backups of your preferences while syncing and provides views for accessing these. In case something goes wrong, you can restore your data from these views.

Settings Sync in Visual Studio Code (9)

You can open these views using Settings Sync: Show Synced Data command from the Command Palette. The Local Sync activity view is hidden by default and you can enable it using Views submenu under Settings Sync view overflow actions.

Settings Sync in Visual Studio Code (10)

Local backups folder in the disk can be accessed via the Settings Sync: Open Local Backups Folder command. The folder is organized by the type of preference and contains versions of your JSON files, named with a timestamp of when the backup occurred.

Note: Local backups are automatically deleted after 30 days. For remote backups the latest 20 versions of each individual resource (settings, extensions, etc.) is retained.

Synced Machines

VS Code keeps track of the machines synchronizing your preferences and provides a view to access them. Every machine is given a default name based on the type of VS Code (Insiders or Stable) and the platform it is on. You can always update the machine name using the edit action available on the machine entry in the view. You can also disable sync on another machine using Turn off Settings Sync context menu action on the machine entry in the view.

Settings Sync in Visual Studio Code (11)

You can open this view using Settings Sync: Show Synced Data command from the Command Palette.

Extension authors

If you are an extension author, you should make sure your extension behaves appropriately when users enable Setting Sync. For example, you probably don't want your extension to display the same dismissed notifications or welcome pages on multiple machines.

Sync user global state between machines

If your extension needs to preserve some user state across different machines then provide the state to Settings Sync using vscode.ExtensionContext.globalState.setKeysForSync. Sharing state such as UI dismissed or viewed flags across machines can provide a better user experience.

There is an example of using setKeysforSync in the Extension Capabilities topic.

Reporting issues

Settings Sync activity can be monitored in the Log (Settings Sync) output view. If you experience a problem with Settings Sync, include this log when creating the issue. If your problem is related to authentication, also include the log from the Account output view.

How do I delete my data?

If you want to remove all your data from our servers, just turn off sync via Settings Sync is On menu available under Manage gear menu and select the checkbox to clear all cloud data. If you choose to re-enable sync, it will be as if you're signing in for the first time.

Next steps

  • User and Workspace settings - Learn how to configure VS Code to your preferences through user and workspace settings.

Common questions

Is VS Code Settings Sync the same as the Settings Sync extension?

No, the Settings Sync extension by Shan Khan uses a private Gist on GitHub to share your VS Code settings across different machines and is unrelated to the VS Code Settings Sync.

What types of accounts can I use for Settings Sync sign in?

VS Code Settings Sync supports signing in with either a Microsoft account (for example Outlook or Azure accounts) or a GitHub account. Sign in with GitHub Enterprise accounts is not supported. Other authentication providers may be supported in the future and you can review the proposed Authentication Provider API in issue #88309.

Note: VS Code Settings Sync does not support using your Microsoft Sovereign Cloud account at this time. If this is something you would like, please let us know what kind of Microsoft Sovereign Cloud you would like to use in this GitHub issue.

Can I use a different backend or service for Settings Sync?

Settings Sync uses a dedicated service to store settings and coordinate updates. A service provider API may be exposed in the future to allow for custom Settings Sync backends.

Troubleshooting keychain issues

Note: This section applies to VS Code version 1.80 and higher. In 1.80, we moved away from keytar, due to its archival, in favor of Electron's safeStorage API.

Note: keychain, keyring, wallet, credential store are synonymous in this document.

Settings Sync persists authentication information on desktop using the OS keychain for encryption. Using the keychain can fail in some cases if the keychain is misconfigured or the environment isn't recognized.

To help diagnose the problem, you can restart VS Code with the following flags to generate a verbose log:

code --verbose --vmodule="*/components/os_crypt/*=1"

Windows & macOS

At this time, there are no known configuration issues on Windows or macOS but, if you suspect something is wrong, you can open an issue on VS Code with the verbose logs from above. This is important for us to support additional desktop configurations.

Linux

Towards the top of the logs from the previous command, you will see something to the effect of:

[9699:0626/093542.027629:VERBOSE1:key_storage_util_linux.cc(54)] Password storage detected desktop environment: GNOME[9699:0626/093542.027660:VERBOSE1:key_storage_linux.cc(122)] Selected backend for OSCrypt: GNOME_LIBSECRET

We rely on Chromium's oscrypt module to discover and store encryption key information in the keyring. Chromium supports a number of different desktop environments. Outlined below are some popular desktop environments and troubleshooting steps that may help if the keyring is misconfigured.

GNOME or UNITY (or similar)

If the error you're seeing is "Cannot create an item in a locked collection", chances are your keyring's Login keyring is locked. You should launch your OS's keyring (Seahorse is the commonly used GUI for seeing keyrings) and ensure the default keyring (usually referred to as Login keyring) is unlocked. This keyring needs to be unlocked when you log into your system.

KDE

KDE 6 is not yet fully supported by Visual Studio Code. As a workaround: The latest kwallet6 is also accessible as kwallet5, so you can force it to use kwallet5 by setting the password store to kwallet5 as explained below in Configure the keyring to use with VS Code.

It's possible that your wallet (aka keyring) is closed. If you open KWalletManager, you can see if the default kdewallet is closed and if it is, make sure you open it.

If you are using KDE5 or higher and are having trouble connecting to kwallet5 (like users of the unofficial VS Code Flatpak in issue #189672), you can try configuring the keyring to gnome-libsecret as this will use the Secret Service API to communicate with any valid keyring. kwallet5 implements the Secret Service API and can be accessed using this method.

Other Linux desktop environments

First off, if your desktop environment wasn't detected, you can open an issue on VS Code with the verbose logs from above. This is important for us to support additional desktop configurations.

(recommended) Configure the keyring to use with VS Code

You can manually tell VS Code which keyring to use by passing the password-store flag. Our recommended configuration is to first install gnome-keyring if you don't have it already and then launch VS Code with code --password-store="gnome-libsecret".

If this solution works for you, you can persist the value of password-store by opening the Command Palette (⇧⌘P (Windows, Linux Ctrl+Shift+P)) and running the Preferences: Configure Runtime Arguments command. This will open the argv.json file where you can add the setting "password-store":"gnome-libsecret".

Here are all the possible values of password-store if you would like to try using a different keyring than gnome-keyring:

  • kwallet5: For use with kwalletmanager5.
  • gnome-libsecret: For use with any package that implements the Secret Service API (for example gnome-keyring, kwallet5, KeepassXC).
  • (not recommended) kwallet: For use with older versions of kwallet.
  • (not recommended) basic: See the section below on basic text for more details.

Don't hesitate to open an issue on VS Code with the verbose logs if you run into any issues.

(not recommended) Configure basic text encryption

We rely on Chromium's oscrypt module to discover and store encryption key information in the keyring. Chromium offers an opt-in fallback encryption strategy that uses an in-memory key based on a string that is hardcoded in the Chromium source. Because of this, this fallback strategy is, at best, obfuscation, and should only be used if you are accepting of the risk that any process on the system could, in theory, decrypt your stored secrets.

If you accept this risk, you can set password-store to basic by opening the Command Palette (⇧⌘P (Windows, Linux Ctrl+Shift+P)) and running the Preferences: Configure Runtime Arguments command. This will open the argv.json file where you can add the setting "password-store":"basic".

Yes. Please refer to the Syncing Stable versus Insiders section for more information.

Please note that this can sometimes lead to data incompatibility because Insiders builds are newer than Stable builds. In such cases, Settings Sync will be disabled automatically on Stable to prevent data inconsistencies. Once a newer version of the Stable build is released, you can upgrade your client and turn on Settings Sync to continue syncing.

04/04/2024

Settings Sync in Visual Studio Code (2024)

FAQs

What is VS Code settings sync? ›

Introduction. The introduction of Settings Sync as a built-in functionality lets you share your VS Code configurations across multiple machines and not worry about installing dependencies afresh or environment configuration when working on another machine or with your team. This was added into version 1.48.

How to turn off settings sync in VS Code? ›

Search for settings sync off in your VS Code Command Palette and hit Enter . This will only work properly inside of VS Code Desktop. If you choose to disable Settings Sync inside of VS Code Browser, you will have to disable it in every new workspace and every time a workspace restarts.

Can you sync Visual Studio? ›

Visual Studio helps you keep your local branch synchronized with your remote branch through download (fetch and pull) and upload (push) operations. You can fetch, pull, and sync in Visual Studio 2022 by using the Git menu. In the preceding screenshot, the Fetch option is highlighted.

What does "sync settings" mean? ›

Sync, short for synchronization, refers to the process of ensuring that the data on two or more devices is consistent and up to date. In other words, synchronization involves making sure that the same files and information are available on all devices that are being synced.

What does "sync" mean? ›

Sync, short for synchronize, means two, or more, things working in harmony. For example, if a movie was out of sync. The actor's lip movements wouldn't match up with the audio track.

What is the difference between push and sync in VS Code? ›

Know about Git Push using VS Code

These are using Sync Changes and Push operation. Sync Changes : It will first pull from your remote GitHub repository and then push it. Sync will do pull and push both. Push: It will only push your changes to your remote GitHub repository.

Where are VS Code settings stored? ›

Workspace settings are stored in . vscode/settings. json when you open a folder as a workspace.

How do I reset VS Code settings? ›

The gear icon (More Actions... Shift+F9) opens a context menu with options to reset a setting to its default value, and to copy the setting ID or copy a JSON name-value pair.

How do I turn off sync settings? ›

Click the Start button and open Settings. Browse to Accounts and select Sync your settings. Toggle off the Sync settings switch to turn off Microsoft sync. If that doesn't work, sign out then back in to your Microsoft account.

How can I turn off sync? ›

After you sign out and turn off sync, you can still find your bookmarks, history, passwords, and other settings on your device.
  1. On your Android device, open Chrome .
  2. On the right of the address bar, tap More Settings.
  3. Tap your name.
  4. Tap Sign out and turn off sync.

Does Visual Studio sync extensions? ›

You can: Click on Allow synchronous autoload to allow extensions to autoload. To change this setting in Visual Studio options, click Environment, then click Extensions, and then select the checkbox "Allow synchronous autoload of extensions".

How do I turn on cloud changes in VS Code? ›

VS Code - How to turn on cloud changes on Visual Studio Code

The first step is to open Visual Studio Code, and Click Settings at the bottom left. Click Profile icon. Click Turn on Cloud Changes. Select the Account to sign in with.

How to edit settings.json in VS Code? ›

To edit settings. json , utilize the Command Palette Cmd + Shift + P for macOS or Ctrl + Shift + P for Windows and then type “Preferences: Open Settings (JSON)”. When utilizing the settings UI editor, either of the first two tabs, User or Remote [{SERVER_ADDRESS}], will work to change User settings.

What is code sync? ›

code_sync auto-syncs your code changes in a local directory to a remote machine, so that you can edit your code in your local editor and instantly run those change on a remote machine. Under the hood, code_sync is running an rsync command whenever watchdog notices changes to the code.

What is the difference between push and sync changes in VS Code? ›

Differnce between Sync Changes and Push

Sync Changes : It will first pull from your remote GitHub repository and then push it. Sync will do pull and push both. Push: It will only push your changes to your remote GitHub repository.

What is the difference between default settings and user settings in VS Code? ›

Default settings - This scope represents the default unconfigured setting values. User settings - Apply globally to all VS Code instances. Remote settings - Apply to a remote machine opened by a user.

Top Articles
Latest Posts
Article information

Author: Saturnina Altenwerth DVM

Last Updated:

Views: 5674

Rating: 4.3 / 5 (64 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Saturnina Altenwerth DVM

Birthday: 1992-08-21

Address: Apt. 237 662 Haag Mills, East Verenaport, MO 57071-5493

Phone: +331850833384

Job: District Real-Estate Architect

Hobby: Skateboarding, Taxidermy, Air sports, Painting, Knife making, Letterboxing, Inline skating

Introduction: My name is Saturnina Altenwerth DVM, I am a witty, perfect, combative, beautiful, determined, fancy, determined person who loves writing and wants to share my knowledge and understanding with you.