1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-04 17:24:46 +00:00

add ignore example for #327

This commit is contained in:
deadc0de6
2021-10-11 16:43:41 +02:00
parent 1ca9d9cda4
commit fafc67e5bc

View File

@@ -176,14 +176,6 @@ It is possible to ignore specific patterns when using dotdrop.
The ignore pattern must follow Unix shell-style wildcards, like, for example `*/path/to/file`. The ignore pattern must follow Unix shell-style wildcards, like, for example `*/path/to/file`.
Make sure to quote these when using wildcards in the config file. Make sure to quote these when using wildcards in the config file.
Patterns used for a specific dotfile can be specified relative to the dotfile destination (`dst`).
Similar to a `.gitignore` file, you can prefix ignore patterns with an exclamation point (`!`).
This so-called "negative ignore pattern" will cause any files that match that pattern to __not__ be ignored,
provided they *would have* been ignored by an earlier ignore pattern (dotdrop will warn if that is not the
case). This feature allows you to, for example, ignore all files within a certain directory, except for one
particular one (See example below).
```yaml ```yaml
config: config:
cmpignore: cmpignore:
@@ -198,11 +190,19 @@ dotfiles:
dst: ~/.vim dst: ~/.vim
src: vim src: vim
upignore: upignore:
- "*/undo-dir" - '*/undo-dir'
- "*/plugged" - '*/plugged'
... ...
``` ```
Patterns used for a specific dotfile can be specified relative to the dotfile destination (`dst`).
Similar to a `.gitignore` file, you can prefix ignore patterns with an exclamation point (`!`).
This so-called "negative ignore pattern" will cause any files that match that pattern to __not__ be ignored,
provided they *would have* been ignored by an earlier ignore pattern (dotdrop will warn if that is not the
case). This feature allows you to, for example, ignore all files within a certain directory, except for a
particular one (See examples below).
To completely ignore comparison of a specific dotfile: To completely ignore comparison of a specific dotfile:
```yaml ```yaml
dotfiles: dotfiles:
@@ -210,7 +210,7 @@ dotfiles:
dst: ~/.vim dst: ~/.vim
src: vim src: vim
cmpignore: cmpignore:
- "*" - '*'
``` ```
To ignore a specific directory when updating: To ignore a specific directory when updating:
@@ -227,9 +227,8 @@ To ignore a specific file `testfile` and directory `testdir` when importing:
```yaml ```yaml
config: config:
impignore: impignore:
- "*/testfile" - "*/testfile"
- "testdir" - "testdir"
...
``` ```
To ignore all files within a certain directory relative to `dst`, except one called `custom_plugin.zsh`: To ignore all files within a certain directory relative to `dst`, except one called `custom_plugin.zsh`:
@@ -239,6 +238,17 @@ dotfiles:
src: zsh src: zsh
dst: ~/.config/zsh dst: ~/.config/zsh
upignore: upignore:
- "plugins/*" - "plugins/*"
- "!plugins/custom_plugin.zsh" - "!plugins/custom_plugin.zsh"
```
To ignore everything except a single file named `file`:
```yaml
dotfiles:
d_dir
src: dir
dst: ~/dir
cmpignore:
- '!file'
- '[a-zA-Z0-9]*'
``` ```