Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd ref: get: document --show-url flag #936

Merged
merged 8 commits into from
Jan 24, 2020
20 changes: 20 additions & 0 deletions public/static/docs/command-reference/get.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ name.
the file or directory from. The tip of the default branch is used by default
when this option is not specified.

- `--show-url` - Returns path or url to the location in remote for given path,
jorgeorpinel marked this conversation as resolved.
Show resolved Hide resolved
from where the **file** will be downloaded. `path` is used to specify the location
of the target artifact within the source project in `url`, relative to the project's
root. `url` can be an address to a DVC project or a path to a local DVC project.
When this option is specified, it will not download the files.
Git-only repository is not supported.
jorgeorpinel marked this conversation as resolved.
Show resolved Hide resolved

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

- `-q`, `--quiet` - do not write anything to standard output. Exit with 0 if no
Expand Down Expand Up @@ -181,3 +188,16 @@ Untracked files:
model.bigrams.pkl
model.monograms.pkl
```

### Example: Getting a url for a file in a DVC repository
jorgeorpinel marked this conversation as resolved.
Show resolved Hide resolved
> Note that `dvc get` can be used from anywhere in the file system, as long as
jorgeorpinel marked this conversation as resolved.
Show resolved Hide resolved
> DVC is [installed](/doc/install).

We can use `dvc get --show-url` to get the actual location of the resulting model file from our
[get started example repo](https://github.com/iterative/example-get-started), a
<abbr>DVC project</abbr> hosted on GitHub:
jorgeorpinel marked this conversation as resolved.
Show resolved Hide resolved

```dvc
$ dvc get https://github.com/iterative/example-get-started model.pkl --show-url
https://remote.dvc.org/get-started/66/2eb7f64216d9c2c1088d0a5e2c6951
```