Skip to content

Commit

Permalink
ref: update add --to-remote desc
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgeorpinel committed Mar 15, 2021
1 parent 14b62cc commit d63b07f
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 31 deletions.
54 changes: 28 additions & 26 deletions content/docs/command-reference/add.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,22 @@ option to avoid this, and `dvc commit` to finish the process when needed).
> See also `dvc.yaml` and `dvc run` for more advanced ways to track and version
> intermediate and final results (like ML models).
After checking that each `target` hasn't been added before (or tracked with
other DVC commands), a few actions are taken under the hood:
After checking that each `target` isn't already tracked with DVC, a few actions
are taken under the hood:

1. Calculate the file hash.
2. Move the file contents to the cache (by default in `.dvc/cache`) (or to
remote storage if `--to-remote` is given), using the file hash to form the
cached file path. (See
2. Move the file contents to the cache (transfer them to remote storage with
`--to-remote`), using the file hash to form the cached file path (see
[Structure of cache directory](/doc/user-guide/project-structure/internal-files#structure-of-the-cache-directory)
for more details.)
3. Attempt to replace the file with a link to the cached data (more details on
file linking further down). Skipped if `--to-remote` is used.
4. Create a corresponding `.dvc` file to track the file, using its path and hash
to identify the cached data (with `--to-remote`/`-o`, an external path is
moved to the workspace). The `.dvc` file lists the DVC-tracked file as an
<abbr>output</abbr> (`outs` field). Unless the `--file` option is used, the
`.dvc` file name generated by default is `<file>.dvc`, where `<file>` is the
file name of the first target.
for details).
3. Attempt to replace the file with a link to (or copy of) the cached data (more
details on file linking ahead). A new link is created if a different `--out`
`path` is given. Skipped if `--to-remote` is used
4. Create a `.dvc` file to track the file or directory, saving it's path, and
the hash as a pointer to the cached data. The `.dvc` file lists the data as
an <abbr>output</abbr> (`outs` field). Unless the `--file` option is used,
the `.dvc` file name generated by default is `<file>.dvc`, where `<file>` is
the file name of the first target.
5. Add the `targets` to `.gitignore` in order to prevent them from being
committed to the Git repository (unless `dvc init --no-scm` was used when
initializing the <abbr>DVC project</abbr>).
Expand Down Expand Up @@ -145,27 +144,30 @@ not.
[pattern](https://docs.python.org/3/library/glob.html) specified in `targets`.
Shell style wildcards supported: `*`, `?`, `[seq]`, `[!seq]`, and `**`

- `--external` - allow `targets` that are outside of the DVC repository. See
[Managing External Data](/doc/user-guide/managing-external-data).

> ⚠️ Note that this is an advanced feature for very specific situations and
> not recommended except if there's absolutely no other alternative.
> Additionally, this typically requires an external cache setup (see link
> above).
- `-o <path>`, `--out <path>` - destination `path` inside the workspace to link
(or copy) a data target (instead of using the current working directory).
Directories specified in the path will be created by this command.

- `--to-remote` - import an external target, but don't move it into the
workspace, nor cache it. [Transfer it](#example-transfer-to-remote-storage) it
directly to remote storage (the default one, unless `-r` is specified)
instead. Use `dvc pull` to get the data locally.
- `--to-remote` - allow a target outside of the DVC repository (e.g. an S3
object, SSH directory URL, file on mounted volume, etc.) but don't move it
into the workspace, nor cache it.
[Transfer it](#example-transfer-to-remote-storage) it directly to remote
storage instead (the default one unless `-r` is specified). Use `dvc pull` to
get the data locally.

- `-r <name>`, `--remote <name>` - name of the
[remote storage](/doc/command-reference/remote) to transfer external target to
(can only be used with `--to-remote`).

- `--external` - allow `targets` that are outside of the DVC repository, to
track in-place. See
[Managing External Data](/doc/user-guide/managing-external-data).

> ⚠️ Note that this is an advanced feature for very specific situations and
> not recommended except if there's absolutely no other alternative.
> Additionally, this typically requires an external cache setup (see link
> above).
- `--desc <text>` - user description of the data (optional). This doesn't affect
any DVC operations.

Expand Down
4 changes: 2 additions & 2 deletions content/docs/command-reference/import-url.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ $ dvc run -n download_data \

- `--to-remote` - import an external target, but don't move it into the
workspace, nor cache it. [Transfer](#example-import-straight-to-the-remote) it
directly to remote storage (the default one, unless `-r` is specified)
instead. Use `dvc pull` to get the data locally.
directly to remote storage (the default one unless `-r` is specified) instead.
Use `dvc pull` to get the data locally.

- `-r <name>`, `--remote <name>` - name of the
[remote storage](/doc/command-reference/remote) (can only be used with
Expand Down
7 changes: 4 additions & 3 deletions content/docs/command-reference/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ $ dvc update --rev master

- `--to-remote` - update a `.dvc` file created with `dvc import-url` and
[transfer](/doc/command-reference/import-url#example-import-straight-to-the-remote)
the new data directly to remote storage (the default one unless `-r` is used).
No changes are done in the <abbr>workspace</abbr>. Use `dvc pull` to get the
data locally. This option can't be used with DVC or Git repository imports.
the new data directly to remote storage (the default one unless `-r` is
specified). No changes are done in the <abbr>workspace</abbr>. Use `dvc pull`
to get the data locally. This option can't be used with DVC or Git repository
imports.

- `-r <name>`, `--remote <name>` - name of the
[remote storage](/doc/command-reference/remote) (can only be used with
Expand Down

0 comments on commit d63b07f

Please sign in to comment.