# org create snapshot

Create a snapshot of a scratch org.

## Description for org create snapshot

A snapshot is a point-in-time copy of a scratch org. The copy is referenced by its unique name in a scratch org definition file.

Use "sf org get snapshot" to get details, including status, about a snapshot creation request.

To create a scratch org from a snapshot, include the "snapshot" option (instead of "edition") in the scratch org definition file and set it to the name of the snapshot. Then use "sf org create scratch" to create the scratch org.

## Aliases for org create snapshot

`force:org:snapshot:create`

## Flags

| Flag Name (Long)   | Flag Name (Short) | Description                                                                                                                                                                                                             |
| ------------------ | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--api-version`    | N/A               | **Type:** Value<br><br>Override the api version used for api requests made by this command                                                                                                                              |
| `--description`    | `-d`              | **Type:** Value<br><br>Description of snapshot.<br><br>Use this description to document the contents of the snapshot. We suggest that you include a reference point, such as a version control system tag or commit ID. |
| `--flags-dir`      | N/A               | **Type:** Value<br><br>Import flag values from a directory.                                                                                                                                                             |
| `--json`           | N/A               | **Type:** Boolean<br><br>Format output as json.                                                                                                                                                                         |
| `--name`           | `-n`              | **Type:** Value<br>**Required**<br><br>Unique name of snapshot.                                                                                                                                                         |
| `--source-org`     | `-o`              | **Type:** Value<br>**Required**<br><br>ID or locally authenticated username or alias of scratch org to snapshot.                                                                                                        |
| `--target-dev-hub` | `-v`              | **Type:** Value<br>**Required**<br><br>Username or alias of the Dev Hub org. Not required if the `target-dev-hub` configuration variable is already set.                                                                |

## Examples for org create snapshot

Create a snapshot called "Dependencies" using the source scratch org ID and your default Dev Hub org:

```shell
sf org create snapshot --source-org 00Dxx0000000000 --name Dependencies --description 'Contains PackageA v1.1.0'
```

Create a snapshot called "NightlyBranch" using the source scratch org username and a Dev Hub org with alias NightlyDevHub:

```shell
sf org create snapshot --source-org myuser@myorg --name NightlyBranch --description 'Contains PkgA v2.1.0 and PkgB 3.3.0' --target-dev-hub NightlyDevHub
```
