2022-03-25 23:15:41 +00:00
|
|
|
Enhancement: Support negative include/exclude patterns
|
2019-07-02 19:36:23 +00:00
|
|
|
|
2022-03-25 23:15:41 +00:00
|
|
|
If a pattern starts with an exclamation mark and it matches a file that was
|
|
|
|
previously matched by a regular pattern, the match is cancelled. Notably,
|
|
|
|
this can be used with `--exclude-file` to cancel the exclusion of some files.
|
2019-07-02 19:36:23 +00:00
|
|
|
|
2022-03-25 23:15:41 +00:00
|
|
|
It works similarly to `.gitignore`, with the same limitation; Once a directory
|
|
|
|
is excluded, it is not possible to include files inside the directory.
|
2019-07-02 19:36:23 +00:00
|
|
|
|
2022-03-25 23:15:41 +00:00
|
|
|
Example of use as an exclude pattern for the `backup` command:
|
2019-07-02 19:36:23 +00:00
|
|
|
|
|
|
|
$HOME/**/*
|
|
|
|
!$HOME/Documents
|
|
|
|
!$HOME/code
|
|
|
|
!$HOME/.emacs.d
|
|
|
|
!$HOME/games
|
|
|
|
# [...]
|
|
|
|
node_modules
|
|
|
|
*~
|
|
|
|
*.o
|
|
|
|
*.lo
|
|
|
|
*.pyc
|
|
|
|
# [...]
|
|
|
|
$HOME/code/linux/*
|
|
|
|
!$HOME/code/linux/.git
|
|
|
|
# [...]
|
|
|
|
|
|
|
|
https://github.com/restic/restic/issues/233
|
|
|
|
https://github.com/restic/restic/pull/2311
|