# Fix VS Code Settings Sync Conflict Between Machines

You use VS Code Settings Sync to share your configuration across multiple machines, but settings from one machine overwrite the correct settings on another. Extensions install on the wrong OS, keybindings conflict, or settings become a jumbled mix of configurations from all machines.

Understanding Settings Sync

VS Code Settings Sync stores your configuration in the cloud (GitHub account or Microsoft account) and synchronizes it across all your VS Code installations. The following items are synced:

  • Settings (settings.json)
  • Keybindings (keybindings.json)
  • Snippets
  • Extensions
  • UI State
  • Tasks

Problem: Settings Overwriting Across Machines

The most common issue: you configure Linux-specific settings on your Linux machine, sync, and they overwrite your Windows settings:

```json // On Linux machine, synced to cloud: { "terminal.integrated.defaultProfile.linux": "bash", "files.autoSave": "afterDelay" }

// On Windows machine, after sync: { "terminal.integrated.defaultProfile.linux": "bash", // Irrelevant on Windows "files.autoSave": "afterDelay" // May not be desired on Windows } ```

Solution: Use Machine-Specific Settings

VS Code supports machine-specific settings that override synced settings:

```json // settings.json (synced) { "editor.fontSize": 14, "editor.tabSize": 4 }

// Machine-specific overrides (NOT synced) ```

Machine-specific settings are stored in a separate file that is NOT synced:

  • Linux: ~/.config/Code/User/settings.json (machine-specific section)
  • Windows: %APPDATA%\Code\User\settings.json (machine-specific section)
  • macOS: ~/Library/Application Support/Code/User/settings.json (machine-specific section)

Use the machine scope in settings:

```json { // Synced settings "editor.fontSize": 14,

// Machine-specific (use platform-specific keys) "terminal.integrated.defaultProfile.windows": "PowerShell", "terminal.integrated.defaultProfile.linux": "bash", "terminal.integrated.defaultProfile.osx": "zsh" } ```

Solution: Use Settings Profiles

For completely different configurations on different machines, use Settings Profiles:

bash
Gear Icon > Settings Profiles > Create Profile

Create profiles like "Work", "Personal", "Linux", "Windows". Each profile has its own settings, extensions, and keybindings. Settings Sync can sync profiles separately.

Resolving a Sync Conflict

When VS Code detects a conflict between local and cloud settings:

bash
Settings Sync: Detected a conflict. Choose which version to keep.
[Keep Local] [Keep Cloud] [Show Differences]

Click "Show Differences" to compare side by side. Choose carefully -- "Keep Cloud" overwrites your local settings with the cloud version.

Manual Conflict Resolution

If you need to resolve conflicts manually:

  1. 1.View your synced settings:
  2. 2.`
  3. 3.Preferences: Open Settings (JSON)
  4. 4.`
  5. 5.View the cloud version:
  6. 6.`
  7. 7.Settings Sync: Show Synced Data
  8. 8.`
  9. 9.Manually merge the differences, then sync:
  10. 10.`
  11. 11.Settings Sync: Update Settings on Server
  12. 12.`

Stopping and Restarting Sync

If sync is completely broken, reset it:

bash
Settings Sync: Turn Off
Settings Sync: Turn On

When turning back on, you will be asked: - "Merge" -- Combine local and cloud settings - "Replace Local" -- Overwrite local with cloud - "Replace Cloud" -- Overwrite cloud with local

Choose "Merge" for the safest option.

Excluding Settings From Sync

If certain settings should not be synced:

json
{
    "settingsSync.ignoredSettings": [
        "window.titleBarStyle",
        "update.channel",
        "telemetry.telemetryLevel"
    ]
}

These settings remain local and are not affected by sync.

Diagnosing Sync Issues

Check the Settings Sync log:

bash
Help > Toggle Developer Tools > Console

Filter for "settingsSync" to see sync operations, conflicts, and errors.

Or check the Sync activity:

bash
Settings Sync: Show Synced Data

This opens a view showing all synced items, their timestamps, and which machine last modified them.

Best Practices for Multi-Machine Sync

  1. 1.Use platform-specific keys instead of generic ones:
  2. 2.```json
  3. 3."terminal.integrated.defaultProfile.windows": "PowerShell"
  4. 4."terminal.integrated.defaultProfile.linux": "bash"
  5. 5.`
  6. 6.Avoid absolute paths in synced settings:
  7. 7.```json
  8. 8.// BAD: Path exists only on one machine
  9. 9."python.defaultInterpreterPath": "/home/user/projects/venv/bin/python"

// GOOD: Use workspace-level settings for paths ```

  1. 1.Use workspace settings for project-specific configuration:
  2. 2.`
  3. 3..vscode/settings.json (not synced)
  4. 4.`
  5. 5.Review sync conflicts before accepting -- do not blindly click "Keep Cloud"