Skip to content

Commit

Permalink
cmd ref: improve last paragraph of re-importing example in import
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgeorpinel committed Nov 18, 2019
1 parent b848aa8 commit 2cb3aaa
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions static/docs/command-reference/import.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,22 +148,28 @@ deps:
rev_lock: 0547f5883fb18e523e35578e2f0d19648c8f2d5c
```

If the Git revision tends to move, i.e. branches, this doesn't have much of an
effect on the import/update workflow. However, for typically static references
i.e. tags, or for SHA commits, `dvc update` will not have any effect on the
import. In this cases, in order to actually "update" an import, it's necessary
to **re-import the data** instead, by using `dvc import` again without or with a
different `--rev`. For example:
If the
[Git revision](https://git-scm.com/book/en/v2/Git-Internals-Git-References)
tends to move, i.e. branches, this doesn't have much of an effect on the
import/update workflow. However, for typically static references i.e. tags, or
for SHA commits, `dvc update` will not have any effect on the import.

In this cases, in order to actually "update" an import, it's necessary to
**re-import the data** instead, by using `dvc import` again without or with a
different `--rev`. This will overwrite the import stage (DVC-file), either
removing or replacing the `rev` field, respectively. This can produce an import
stage that is able to be updated normally with `dvc update` going forward. For
example:

```dvc
$ dvc import --rev master \
[email protected]:iterative/dataset-registry.git \
use-cases/cats-dogs
```

This will overwrite the import stage (DVC-file) either removing or replacing the
`rev` field. This can produce an import stage that is able to be updated
normally with `dvc update` going forward.
> In the above example, the value for `rev` in the new import stage will be
> `master`, which happens to be the default branch in this Git repository, so
> the command is equivalent to not using `--rev` at all.

## Example: Data registry

Expand Down

0 comments on commit 2cb3aaa

Please sign in to comment.