> ## Documentation Index
> Fetch the complete documentation index at: https://docs.diversion.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Selective Sync

> Only sync the files you need

This one is for artists who don't want code, or for developers who aren't artistically inclined.

## What is Selective Sync?

Selective Sync is a feature that allows you to choose which folders you want to sync locally. This will allow you to only have the files you need to work on, saving space on your computer.

## How to use Selective Sync

Open the workspace's **... (more options) menu** next to the workspace selector ("THIS WORKSPACE") and choose Selective sync.

<Steps>
  <Step title="Open your repo">
    From your local folder, run `dv view`, or click the View Repo button in the UI.

    <img alt="Open repo" style={{width: '90%', borderRadius: '1.5rem', border: '.3rem solid #555', boxShadow: '0 0 1rem #888' }} src="https://mintcdn.com/diversion-2/HhHa-PhS49hu7GIa/images/view-repo-button.png?fit=max&auto=format&n=HhHa-PhS49hu7GIa&q=85&s=770e3422fcee4a3d6f1171e7ab53f79e" width="595" height="201" data-path="images/view-repo-button.png" />
  </Step>

  <Step title="Open the workspace sync settings">
    Click the **... (more options) button** next to the workspace selector to open the "THIS WORKSPACE" menu, then choose **Selective sync** ("Choose which folders sync to this machine").

    <img alt="Open settings" style={{width: '90%', borderRadius: '1.5rem', border: '.3rem solid #555', boxShadow: '0 0 1rem #888' }} src="https://mintcdn.com/diversion-2/UZ43CqMpCXHHcPfk/images/workspace-settings.png?fit=max&auto=format&n=UZ43CqMpCXHHcPfk&q=85&s=88ac1cc6fa6e6f1f8a5a8811679d4a4b" width="423" height="291" data-path="images/workspace-settings.png" />
  </Step>

  <Step title="Welcome to Selective sync.">
    <img alt="Selective Sync page" style={{width: '90%', borderRadius: '1.5rem', border: '.3rem solid #555', boxShadow: '0 0 1rem #888' }} src="https://mintcdn.com/diversion-2/zdFp0wmCrPve5JMp/images/selective-sync-page.png?fit=max&auto=format&n=zdFp0wmCrPve5JMp&q=85&s=b1872da88e84a160ac7bcbac691f86ca" width="882" height="580" data-path="images/selective-sync-page.png" />
  </Step>
</Steps>

### Unsyncing a folder

Let's take a look at `folder 1`.

In the UI:

<img alt="Selective Sync ui full" style={{width: '90%', borderRadius: '1.5rem', border: '.3rem solid #555', boxShadow: '0 0 1rem #888' }} src="https://mintcdn.com/diversion-2/zdFp0wmCrPve5JMp/images/selective-sync-folder1-full-ui.png?fit=max&auto=format&n=zdFp0wmCrPve5JMp&q=85&s=59872cec20ecbb8ab2c89afefc908b9e" width="541" height="238" data-path="images/selective-sync-folder1-full-ui.png" />

And locally:

<img alt="Selective Sync local full" style={{width: '90%', borderRadius: '1.5rem', border: '.3rem solid #555', boxShadow: '0 0 1rem #888' }} src="https://mintcdn.com/diversion-2/zdFp0wmCrPve5JMp/images/selective-sync-folder1-full-local.png?fit=max&auto=format&n=zdFp0wmCrPve5JMp&q=85&s=ce1657a677598e248386576eb682df0d" width="102" height="110" data-path="images/selective-sync-folder1-full-local.png" />

Let's unsync `folder 1.2`. Unselect the folder in the UI and hit Save.

<img alt="Selective Sync removing folder 1.2" style={{width: '90%', borderRadius: '1.5rem', border: '.3rem solid #555', boxShadow: '0 0 1rem #888' }} src="https://mintcdn.com/diversion-2/HhHa-PhS49hu7GIa/images/selective-sync-unselecting-1.2.png?fit=max&auto=format&n=HhHa-PhS49hu7GIa&q=85&s=3a78b83f563d00846524ff2dcc2e390c" width="706" height="551" data-path="images/selective-sync-unselecting-1.2.png" />

Locally, the folder disappears automatically.

<img alt="Selective Sync removed folder 1.2 local" style={{width: '90%', borderRadius: '1.5rem', border: '.3rem solid #555', boxShadow: '0 0 1rem #888' }} src="https://mintcdn.com/diversion-2/zdFp0wmCrPve5JMp/images/selective-sync-1.2-missing-local.png?fit=max&auto=format&n=zdFp0wmCrPve5JMp&q=85&s=558172d7117c0c30620112fd0cf39b45" width="136" height="97" data-path="images/selective-sync-1.2-missing-local.png" />

It's also missing in the UI.

<img alt="Selective Sync removed folder 1.2 ui" style={{width: '90%', borderRadius: '1.5rem', border: '.3rem solid #555', boxShadow: '0 0 1rem #888' }} src="https://mintcdn.com/diversion-2/zdFp0wmCrPve5JMp/images/selective-sync-1.2-missing-repo-ui.png?fit=max&auto=format&n=zdFp0wmCrPve5JMp&q=85&s=43dac60a3dc8b2688bb37802d4214cf4" width="242" height="136" data-path="images/selective-sync-1.2-missing-repo-ui.png" />

### What about my uncommitted changes?

Have no fear! If you have any uncommitted changes, you won't be able to change your selective sync settings. Let's see what that looks like.

Inside `folder 1.1`, let's make changes to `text document 1.1.1.txt` and save.

<img alt="Selective Sync editing 1.1.1.txt" style={{width: '90%', borderRadius: '1.5rem', border: '.3rem solid #555', boxShadow: '0 0 1rem #888' }} src="https://mintcdn.com/diversion-2/zdFp0wmCrPve5JMp/images/selective-sync-editing-1.1.1.png?fit=max&auto=format&n=zdFp0wmCrPve5JMp&q=85&s=ea1527c8b6ac708ee65aa0a30a01d947" width="715" height="178" data-path="images/selective-sync-editing-1.1.1.png" />

Back in the workspace settings, let's try to unsync `folder 1.1`.

<img alt="Selective Sync fail to unsync 1.1" style={{width: '90%', borderRadius: '1.5rem', border: '.3rem solid #555', boxShadow: '0 0 1rem #888' }} src="https://mintcdn.com/diversion-2/HhHa-PhS49hu7GIa/images/selective-sync-trying-to-unsync-with-changes.png?fit=max&auto=format&n=HhHa-PhS49hu7GIa&q=85&s=183127ee37683db348bb2bc5bbb20e31" width="626" height="382" data-path="images/selective-sync-trying-to-unsync-with-changes.png" />

We got an error message! We'll have to commit or discard our changes before unsyncing the folder.

<img alt="Selective Sync fail to unsync 1.1 error" style={{width: '90%', borderRadius: '1.5rem', border: '.3rem solid #555', boxShadow: '0 0 1rem #888' }} src="https://mintcdn.com/diversion-2/HhHa-PhS49hu7GIa/images/selective-sync-trying-to-unsync-with-changes-error.png?fit=max&auto=format&n=HhHa-PhS49hu7GIa&q=85&s=13edcab91482f0c349252483d1a9ada2" width="365" height="75" data-path="images/selective-sync-trying-to-unsync-with-changes-error.png" />

## Loose files

Right now, we can only selectively sync folders. This means that files are handled differently, if they're not in a folder.

Let's take a look at `folder 2`.

<img alt="Selective Sync folder with loose file" style={{width: '90%', borderRadius: '1.5rem', border: '.3rem solid #555', boxShadow: '0 0 1rem #888' }} src="https://mintcdn.com/diversion-2/zdFp0wmCrPve5JMp/images/selective-sync-folder-2-loose-file.png?fit=max&auto=format&n=zdFp0wmCrPve5JMp&q=85&s=ba64f54db3a00ee3ee515eb180a5097c" width="197" height="137" data-path="images/selective-sync-folder-2-loose-file.png" />

Notice that it has a file directly under it - `text document 2.1.txt`. In this situation, unsyncing `folder 2.1` will also unsync `text document 2.1.txt`! That's despite the file being a sibling of the folder and not a child of it. This is because `folder 2` will be marked as partially synced, so only explicitly synced folders (in this case, `folder 2.2`) will be kept.

This still supports the main use-case of this feature:

1. Artists who don't want to sync code locally can ignore the root `Source` folder, or equivalent.
2. Developers who don't want to sync heavy assets can ignore the root `Content` folder, or equivalent.

## Per workspace

The selective sync feature works on a per-workspace basis. This means that you can have different selective sync settings for different workspaces. This is useful if you have multiple projects in the same repo, or if you're working on different parts of the same project.
