Skip to content

Commit 072defa

Browse files
committed
cmd ref: simplify and improve --show-url description, et al.
per #936 (review) and #936 (review) also applied #936 (review) and #936 (comment)
1 parent 78055d4 commit 072defa

File tree

1 file changed

+16
-19
lines changed
  • public/static/docs/command-reference

1 file changed

+16
-19
lines changed

public/static/docs/command-reference/get.md

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,10 @@ name.
6565
the file or directory from. The tip of the default branch is used by default
6666
when this option is not specified.
6767

68-
- `--show-url` - Returns path or url to the location in remote for given path,
69-
from where the **file** will be downloaded. `path` is used to specify the location
70-
of the target artifact within the source project in `url`, relative to the project's
71-
root. `url` can be an address to a DVC project or a path to a local DVC project.
72-
When this option is specified, it will not download the files.
73-
Git-only repository is not supported.
68+
- `--show-url` - `url` is expected to represent a DVC project for this option to
69+
have an effect (as opposed to a Git-only, non-DVC repository). When
70+
`--show-url` is used, instead of downloading the file or directory, this
71+
command just prints the storage location (URL) of the target data.
7472

7573
- `-h`, `--help` - prints the usage/help message, and exit.
7674

@@ -126,6 +124,18 @@ $ ls
126124
install.sh
127125
```
128126

127+
### Example: Getting the storage URL of a DVC-tracked file
128+
129+
We can use `dvc get --show-url` to get the actual location of the resulting
130+
model file from our
131+
[get started example repo](https://github.com/iterative/example-get-started), a
132+
<abbr>DVC project</abbr> hosted on GitHub:
133+
134+
```dvc
135+
$ dvc get https://github.com/iterative/example-get-started model.pkl --show-url
136+
https://remote.dvc.org/get-started/66/2eb7f64216d9c2c1088d0a5e2c6951
137+
```
138+
129139
## Example: Compare different versions of data or model
130140

131141
`dvc get` has the `--rev` option, to specify which version of the repository to
@@ -188,16 +198,3 @@ Untracked files:
188198
model.bigrams.pkl
189199
model.monograms.pkl
190200
```
191-
192-
### Example: Getting a url for a file in a DVC repository
193-
> Note that `dvc get` can be used from anywhere in the file system, as long as
194-
> DVC is [installed](/doc/install).
195-
196-
We can use `dvc get --show-url` to get the actual location of the resulting model file from our
197-
[get started example repo](https://github.com/iterative/example-get-started), a
198-
<abbr>DVC project</abbr> hosted on GitHub:
199-
200-
```dvc
201-
$ dvc get https://github.com/iterative/example-get-started model.pkl --show-url
202-
https://remote.dvc.org/get-started/66/2eb7f64216d9c2c1088d0a5e2c6951
203-
```

0 commit comments

Comments
 (0)