Skip to content

Commit 5a3b355

Browse files
authored
doc: misc. updates (#1673)
* cmd: remove unnecessary commas in get and import * cmd: fix typo in add * cmd: remote copy edits per #1617 (comment) * guide: .dvcignore copy edit * cmd: init copy edits * clarify about dirs in import -o * cmd: review get -o desc * dvcignore: updates to guide and check-ignore ref. per #1629 (review) et al. * cmd: update check-ignore -n per iterative/dvc#4323 (comment) * cmd: fix get.import -o descriptions per #1673 (review) and #1673 (review) * cmd: copy edits to remote add/modify
1 parent 8c6e075 commit 5a3b355

File tree

6 files changed

+52
-56
lines changed

6 files changed

+52
-56
lines changed

content/docs/command-reference/check-ignore.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ usage: usage: dvc check-ignore [-h] [-q | -v] [-d] [-n]
1010
targets [targets ...]
1111
1212
positional arguments:
13-
targets File or directory paths to check (wildcards supported)
13+
targets File or directory paths to check
1414
```
1515

1616
## Description
@@ -19,16 +19,15 @@ This helper command checks whether the given `targets` are ignored by DVC
1919
according to the [`.dvcignore` file](/doc/user-guide/dvcignore) (if any). The
2020
ones that are ignored indeed are printed back.
2121

22-
> Note that your shell may support path wildcards such as `dir/file*` and these
23-
> can be fed as `targets` to `dvc check-ignore`, as shown in the
24-
> [examples](#examples).
25-
2622
## Options
2723

28-
- `-d`, `--details` - show the exclude pattern together with each target path.
24+
- `-d`, `--details` - show the exclude patterns along with each target path. A
25+
series of lines are printed in this format:
26+
`<path/to/.dvcignore>:<line_num>:<pattern> <target_path>`
2927

30-
- `-n`, `--non-matching` - show the target paths which don’t match any pattern.
31-
Only usable when `--details` is also employed
28+
- `-n`, `--non-matching` - include the target paths which don’t match any
29+
pattern in the `--details` list. All fields in each line, except for
30+
`<target_path>`, will be empty. Has no effect without `--details`.
3231

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

@@ -40,13 +39,14 @@ ones that are ignored indeed are printed back.
4039
## Examples
4140

4241
First, let's create a `.dvcignore` file with some patterns in it, and some files
43-
to check against it.
42+
to check against it:
4443

4544
```dvc
4645
$ echo "file*\n\!file2" >> .dvcignore
4746
$ cat .dvcignore
4847
file*
4948
!file2
49+
5050
$ touch file1 file2 other
5151
$ ls
5252
file1 file2 other
@@ -58,31 +58,33 @@ given our `.dvcignore` file:
5858
```dvc
5959
$ dvc check-ignore file1
6060
file1
61+
6162
$ dvc check-ignore file1 file2
6263
file1
6364
file2
65+
6466
$ dvc check-ignore other
6567
# There's no command output, meaning `other` is not excluded.
68+
6669
$ dvc check-ignore file*
6770
file1
6871
file2
6972
```
7073

71-
If the `--details` option is used, a series of lines are printed using this
72-
format: `<path/to/.dvcignore>:<line_num>:<pattern> | <target_path>`
74+
With `--details` (`-d`), we get a detailed report of all the matches:
7375

7476
```dvc
7577
$ dvc check-ignore -d file1 file2
7678
.dvcignore:1:file* file1
7779
.dvcignore:2:!file2 file2
78-
$ dvc check-ignore -d other
80+
7981
$ dvc check-ignore -d file*
8082
.dvcignore:1:file* file1
8183
.dvcignore:2:!file2 file2
8284
```
8385

84-
With the `--non-matching` option, non-matching `targets` will also be included
85-
in the list. All fields in each line, except for `<target path>`, will be empty.
86+
With the `--non-matching` (`-n`) option, non-matching `targets` will also be
87+
included in the details list:
8688

8789
```dvc
8890
$ dvc check-ignore -d -n other

content/docs/command-reference/get.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,10 @@ name.
5555

5656
## Options
5757

58-
- `-o <path>`, `--out <path>` - specify a path (directory and/or file name) to
59-
the desired location to place the download file in. The default value (when
60-
this option isn't used) is the current working directory (`.`) and original
61-
file name. If an existing directory is specified, then the target data will be
62-
placed inside.
58+
- `-o <path>`, `--out <path>` - specify a path to the desired location in the
59+
workspace to place the downloaded file or directory (instead of using the
60+
current working directory). Directories specified in the path will be created
61+
by this command.
6362

6463
- `--rev <commit>` - commit hash, branch or tag name, etc. (any
6564
[Git revision](https://git-scm.com/docs/revisions)) of the repository to

content/docs/command-reference/import.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,10 @@ from the source repo.
7575

7676
## Options
7777

78-
- `-o <path>`, `--out <path>` - specify a path (directory and/or file name) to
79-
the desired location to place the imported file in (instead of using the
80-
current working directory). If an existing directory is specified, the target
81-
data will be placed inside. If `path` contains a parent directory which does
82-
not exist, this command will fail.
78+
- `-o <path>`, `--out <path>` - specify a path to the desired location in the
79+
workspace to place the downloaded file or directory (instead of using the
80+
current working directory). Directories specified in the path should already
81+
exist, otherwise this command will fail.
8382

8483
- `--rev <commit>` - commit hash, branch or tag name, etc. (any
8584
[Git revision](https://git-scm.com/docs/revisions)) of the repository to

content/docs/command-reference/remote/add.md

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -155,23 +155,22 @@ For more information about the variables DVC supports, please visit
155155
### Click for Microsoft Azure Blob Storage
156156

157157
```dvc
158-
$ dvc remote add --local myremote azure://my-container-name/path
158+
$ dvc remote add -d myremote azure://my-container-name/path
159159
$ dvc remote modify --local myremote connection_string \
160-
"my-connection-string"
160+
'my-connection-string'
161161
```
162162

163-
> The connection string contains access to data and is inserted into the
164-
> `.dvc/config` file. Therefore, it is safer to add the remote with the
165-
> `--local` option, enforcing it to be written to a Git-ignored config file. See
166-
> `dvc remote modify` for a full list of Azure storage parameters.
163+
> The connection string contains sensitive user info. Therefore, it's safer to
164+
> add it with the `--local` option, so it's written to a Git-ignored config
165+
> file. See `dvc remote modify` for a full list of Azure storage parameters.
167166
168167
The Azure Blob Storage remote can also be configured globally via environment
169168
variables:
170169

171170
```dvc
172-
$ export AZURE_STORAGE_CONNECTION_STRING="<my-connection-string>"
173-
$ export AZURE_STORAGE_CONTAINER_NAME="my-container-name"
174-
$ dvc remote add -d myremote "azure://"
171+
$ export AZURE_STORAGE_CONNECTION_STRING='<my-connection-string>'
172+
$ export AZURE_STORAGE_CONTAINER_NAME='my-container-name'
173+
$ dvc remote add -d myremote 'azure://'
175174
```
176175

177176
> For more information on configuring Azure Storage connection strings, visit
@@ -181,7 +180,7 @@ $ dvc remote add -d myremote "azure://"
181180
Storage Account. If you don't already have a storage account, you can create
182181
one following
183182
[these instructions](https://docs.microsoft.com/en-us/azure/storage/common/storage-create-storage-account).
184-
The connection string can be found in the "Access Keys" pane of your Storage
183+
The connection string can be found in the **Access Keys** pane of your Storage
185184
Account resource in the Azure portal.
186185

187186
> 💡 Make sure the value is quoted so its processed correctly by the console.
@@ -198,13 +197,12 @@ $ dvc remote add -d myremote "azure://"
198197

199198
To start using a GDrive remote, first add it with a
200199
[valid URL format](/doc/user-guide/setup-google-drive-remote#url-format). Then
201-
simply use any DVC command that needs it (e.g. `dvc pull`, `dvc fetch`,
202-
`dvc push`), and follow the instructions to connect your Google Drive with DVC.
203-
For example:
200+
use any DVC command that needs to connect to it (e.g. `dvc pull` or `dvc push`
201+
once there's tracked data to synchronize). For example:
204202

205203
```dvc
206204
$ dvc remote add -d myremote gdrive://0AIac4JZqHhKmUk9PDA/dvcstore
207-
$ dvc push
205+
$ dvc push # Assuming there's data to push
208206
209207
Go to the following link in your browser:
210208
@@ -262,18 +260,18 @@ To set key id, key secret and endpoint (or any other OSS parameter), use
262260
option to avoid committing your secrets with Git:
263261

264262
```dvc
263+
$ dvc remote modify myremote oss_endpoint <endpoint>
265264
$ dvc remote modify myremote --local oss_key_id my-key-id
266265
$ dvc remote modify myremote --local oss_key_secret my-key-secret
267-
$ dvc remote modify myremote oss_endpoint endpoint
268266
```
269267

270268
You can also set environment variables and use them later, to set environment
271269
variables use following environment variables:
272270

273271
```dvc
274-
$ export OSS_ACCESS_KEY_ID="my-key-id"
275-
$ export OSS_ACCESS_KEY_SECRET="my-key-secret"
276-
$ export OSS_ENDPOINT="endpoint"
272+
$ export OSS_ACCESS_KEY_ID='my-key-id'
273+
$ export OSS_ACCESS_KEY_SECRET='my-key-secret'
274+
$ export OSS_ENDPOINT='endpoint'
277275
```
278276

279277
**Testing your OSS storage using docker**
@@ -353,16 +351,14 @@ $ dvc remote add -d myremote webdavs://example.com/public.php/webdav
353351

354352
> See also `dvc remote modify` for a full list of WebDAV parameters.
355353
356-
> Note that the location of the WebDAV API endpoint `/public.php/webdav` might
357-
> be different for your server.
358-
359354
</details>
360355

361356
<details>
362357

363358
### Click for local remote
364359

365-
A "local remote" is a directory in the machine's file system.
360+
A "local remote" is a directory in the machine's file system. Not to be confused
361+
with the `--local` option of `dvc remote` commands!
366362

367363
> While the term may seem contradictory, it doesn't have to be. The "local" part
368364
> refers to the type of location where the storage is: another directory in the
@@ -385,7 +381,7 @@ $ cat .dvc/config
385381
Using a relative path:
386382

387383
```dvc
388-
$ dvc remote add myremote ../my-dvc-storage
384+
$ dvc remote add -d myremote ../my-dvc-storage
389385
$ cat .dvc/config
390386
...
391387
['remote "myremote"']

content/docs/command-reference/remote/modify.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -224,17 +224,17 @@ must explicitly set the `endpointurl` in the configuration:
224224
For example:
225225

226226
```dvc
227-
$ dvc remote add myremote s3://path/to/dir
227+
$ dvc remote add -d myremote s3://path/to/dir
228228
$ dvc remote modify myremote endpointurl \
229229
https://object-storage.example.com
230230
```
231231

232232
S3 remotes can also be configured entirely via environment variables:
233233

234234
```dvc
235-
$ export AWS_ACCESS_KEY_ID="<my-access-key>"
236-
$ export AWS_SECRET_ACCESS_KEY="<my-secret-key>"
237-
$ dvc remote add myremote "s3://bucket/myremote"
235+
$ export AWS_ACCESS_KEY_ID='<my-access-key>'
236+
$ export AWS_SECRET_ACCESS_KEY='<my-secret-key>'
237+
$ dvc remote add -d myremote 's3://bucket/myremote'
238238
```
239239

240240
For more information about the variables DVC supports, please visit
@@ -249,14 +249,14 @@ For more information about the variables DVC supports, please visit
249249
- `url` - remote location URL.
250250

251251
```dvc
252-
$ dvc remote modify myremote url "azure://my-container-name/path"
252+
$ dvc remote modify myremote url 'azure://my-container-name/path'
253253
```
254254

255255
- `connection_string` - connection string.
256256

257257
```dvc
258258
$ dvc remote modify --local myremote connection_string \
259-
"my-connection-string"
259+
'my-connection-string'
260260
```
261261

262262
> The connection string contains sensitive user info. Therefore, it's safer to
@@ -399,13 +399,13 @@ more information.
399399

400400
```dvc
401401
$ dvc remote modify \
402-
myremote credentialpath "/home/.../project-XXXXXXX.json"
402+
myremote credentialpath '/home/.../project-XXXXXXX.json'
403403
```
404404

405405
Alternatively, the `GOOGLE_APPLICATION_CREDENTIALS` env var can be set:
406406

407407
```dvc
408-
$ export GOOGLE_APPLICATION_CREDENTIALS=".../project-XXXXXXX.json"
408+
$ export GOOGLE_APPLICATION_CREDENTIALS='.../project-XXXXXXX.json'
409409
```
410410

411411
</details>

content/docs/user-guide/dvcignore.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ DVC-handled directories.
3333
they are not produced by a pipeline [stage](/doc/command-reference/run), they
3434
can be lost permanently.
3535

36-
Keep in mind, that when you add `.dvcignore` patterns that affect an existing
36+
Keep in mind that when you add `.dvcignore` patterns that affect an existing
3737
<abbr>output</abbr>, its status will change and DVC will behave as if that
3838
affected files were deleted.
3939

0 commit comments

Comments
 (0)