Skip to content

Commit

Permalink
cmd: update commit, fetch, and status to match push and pull
Browse files Browse the repository at this point in the history
Continues #1602
  • Loading branch information
jorgeorpinel committed Aug 18, 2020
1 parent 1d4d56d commit 956ba43
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 24 deletions.
9 changes: 6 additions & 3 deletions content/docs/command-reference/commit.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ positional arguments:

## Description

The `dvc commit` command is useful for several scenarios, when data already
tracked by DVC changes: when a [stage](/doc/command-reference/run) or
`dvc commit` is useful for several scenarios, when data already tracked by DVC
changes: when a [stage](/doc/command-reference/run) or
[pipeline](/doc/command-reference/dag) is in development/experimentation; when
manually editing or generating DVC <abbr>outputs</abbr>; or to force DVC-file
updates without reproducing stages or pipelines. These scenarios are further
Expand Down Expand Up @@ -66,11 +66,14 @@ computed and added to the DVC-file, but the actual data file is not saved in the
cache. This is where the `dvc commit` command comes into play. It performs that
last step (saving the data in cache).

Note that it's best to avoid the last two scenarios. They essentially
Keep in ming that it's best to avoid the last two scenarios. They essentially
force-update the [DVC-files](/doc/user-guide/dvc-files-and-directories) and save
data to cache. They are still useful, but keep in mind that DVC can't guarantee
reproducibility in those cases.

> Note that committing data does not affect code, `dvc.yaml`, or `.dvc` files.
> Those should be saved with `git commit`.
## Options

- `-d`, `--with-deps` - determines files to commit by tracking dependencies to
Expand Down
37 changes: 21 additions & 16 deletions content/docs/command-reference/fetch.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# fetch

Get tracked files or directories from
[remote storage](/doc/command-reference/remote) into the <abbr>cache</abbr>.
Download tracked files or directories from
[remote storage](/doc/command-reference/remote) based on the current `dvc.yaml`
and `.dvc` files.

## Synopsis

Expand All @@ -17,22 +18,16 @@ positional arguments:

## Description

Downloads DVC-tracked files from remote storage into the cache of the project
(without placing them in the <abbr>workspace</abbr>, like `dvc pull` would).
This makes them available for linking (or copying) into the workspace (refer to
[`dvc config cache.type`](/doc/command-reference/config#cache)).
`dvc fetch` downloads tracked dat from remote storage into the
<abbr>cache</abbr> of the project (without placing it in the
<abbr>workspace</abbr> like `dvc pull`). This makes them available for linking
(or copying) into the workspace (refer to `dvc config cache.type`).

Without arguments, `dvc fetch` ensures that the files specified in all
`dvc.lock` and `.dvc` files in the workspace exist in the cache. The
`--all-branches`, `--all-tags`, and `--all-commits` options enable fetching data
for multiple Git commits.
> Note that fetching data does not affect code, `dvc.yaml`, or `.dvc` files.
> Those should be obtained with `git fetch`.
The `targets` given to this command (if any) limit what to fetch. It accepts
paths to tracked files or directories (including paths inside tracked
directories), `.dvc` files, and stage names (found in `dvc.yaml`).

Fetching is performed automatically by `dvc pull` (when the data is not already
in the <abbr>cache</abbr>), along with `dvc checkout`:
Fetching is performed automatically if needed by `dvc pull`, along with
`dvc checkout`:

```
Controlled files Commands
Expand All @@ -51,6 +46,16 @@ project's cache ++ | dvc pull |
workspace
```

Without arguments, it downloads all files and directories missing from the
project, found as <abbr>outputs</abbr> of the
[stages](/doc/command-reference/run) or `.dvc` files present in the workspace.
The `--all-branches`, `--all-tags`, and `--all-commits` options enable fetching
multiple Git commits.

The `targets` given to this command (if any) limit what to fetch. It accepts
paths to tracked files or directories (including paths inside tracked
directories), `.dvc` files, and stage names (found in `dvc.yaml`).

Here are some scenarios in which `dvc fetch` is useful, instead of pulling:

- After checking out a fresh copy of a <abbr>DVC repository</abbr>, to get
Expand Down
9 changes: 4 additions & 5 deletions content/docs/command-reference/status.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,10 @@ _remote_ mode is triggered by using the `--cloud` or `--remote` options:
| remote | `--remote` | Comparisons are made between the cache, and the given remote. Remote storage is defined using the `dvc remote` command. |
| remote | `--cloud` | Comparisons are made between the cache, and the default remote (typically defined with `dvc remote --default`). |

Without arguments, this command checks all stages (defined in `dvc.yaml`) and
`.dvc` files, and compares the hash values of their <abbr>outputs</abbr> (found
in `dvc.lock` for stages) against the actual data files or directories in the
workspace. The `--all-branches`, `--all-tags`, and `--all-commits` options
enable checking data for multiple Git commits.
Without arguments, it checks all [stages](/doc/command-reference/run) and `.dvc`
files, and compares their <abbr>outputs</abbr> against the actual data files or
directories in the workspace. The `--all-branches`, `--all-tags`, and
`--all-commits` options enable checking multiple Git commits.

The `targets` given to this command (if any) limit what to check. It accepts
paths to tracked files or directories (including paths inside tracked
Expand Down

0 comments on commit 956ba43

Please sign in to comment.