> ## 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.

# Shelves

> Save workspace changes temporarily and manage your shelves

In Diversion, you can shelve your current work and apply it later when switching back to the original branch.
This works similarly to the "stash" mechanism in Git.

## When to use shelves

* **Switching context:** Save work-in-progress before switching to another branch
* **Experimenting:** Try out changes without committing, easily revert if the experiment doesn't work
* **Working across machines:** Shelve changes on one computer and apply them on another. Shelves are stored in the cloud per repository, so they are available from any workspace on the same repo.

## Creating a shelf

Use the shelf button in your workspace to create a shelf.

1. Select the files you want to shelve in your workspace
2. Click **Shelve...** to open the naming dialog:

<img src="https://mintcdn.com/diversion-2/_3tfLC_xjbiulVkJ/images/shelves/shelf_menu.png?fit=max&auto=format&n=_3tfLC_xjbiulVkJ&q=85&s=f142fcb23547fe6be24f46e21c3e3fb7" alt="shelf button" style={{width: '300px', height: '70px', borderRadius: '1.0rem', border: '.2rem solid #555', boxShadow: '0 0 1rem #888' }} width="637" height="136" data-path="images/shelves/shelf_menu.png" />

3. [Name](#naming-your-shelf) your shelf
4. Click **Create shelf**

### Automatic shelves

When switching branches with uncommitted changes, a popup menu will ask what to do with them.

<img src="https://mintcdn.com/diversion-2/_3tfLC_xjbiulVkJ/images/shelves/uncommitted_changes_branch_switch.png?fit=max&auto=format&n=_3tfLC_xjbiulVkJ&q=85&s=378faaccf3538f8055d457f8d30a4651" alt="uncommitted changes branch switch menu" style={{width: '260px', height: '200px', borderRadius: '1.0rem', border: '.2rem solid #555', boxShadow: '0 0 1rem #888' }} width="769" height="586" data-path="images/shelves/uncommitted_changes_branch_switch.png" />

Select **Save changes for later use** to create an automatic shelf.

### Naming your shelf

When creating a shelf, you can:

* Enter a custom name (max 60 characters)
* Click **Generate name** <img src="https://mintcdn.com/diversion-2/_3tfLC_xjbiulVkJ/images/shelves/generate_name_button.png?fit=max&auto=format&n=_3tfLC_xjbiulVkJ&q=85&s=2a34e5cbb196a7301183f9c492041169" alt="generate name button" style={{display: 'inline', height: '24px', verticalAlign: 'middle', margin: '0 4px'}} width="25" height="33" data-path="images/shelves/generate_name_button.png" /> to create a name like `my_branch (2025-01-13 13:00:00)`

<Note>Shelf names must be unique within your repository.</Note>

## Managing shelves

Open the branch selector and switch to the **Shelves** tab to view and manage your shelves.

<img src="https://mintcdn.com/diversion-2/byT8FECKa2zLvaOH/images/shelves/shelves_list.png?fit=max&auto=format&n=byT8FECKa2zLvaOH&q=85&s=07ba2933ecf68955fc5cb4c52da0e7b1" alt="shelves list" style={{width: '320px', height: '132px', borderRadius: '1.0rem', border: '.2rem solid #555', boxShadow: '0 0 1rem #888' }} width="870" height="530" data-path="images/shelves/shelves_list.png" />

### Preview

Click on a shelf to preview its contents before applying.

### Apply

Click **Apply** to restore the shelved changes to your workspace.

<Warning>If the shelved changes conflict with your current workspace, you'll need to resolve the conflicts before continuing.</Warning>

### Rename

Click **Rename** to change the shelf name.

### Delete

Click **Delete** to permanently remove a shelf. This action cannot be undone.

***

For CLI usage, see the [shelf](../cmd-ref/shelf) command reference.
