Skip to content

Commit

Permalink
Recommend using '**' to encrypt entire directories
Browse files Browse the repository at this point in the history
gitattributes now supports '**' to mean 'entire subtree'.
Using '*' instead of '**' is an easy mistake to make with pretty
bad consequences. Hopefully this added emphasis will make
it less likely users make the mistake.
  • Loading branch information
yuvipanda authored and AGWA committed May 2, 2019
1 parent af84638 commit 29974b4
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Specify files to encrypt by creating a .gitattributes file:

secretfile filter=git-crypt diff=git-crypt
*.key filter=git-crypt diff=git-crypt
secretdir/** filter=git-crypt diff=git-crypt

Like a .gitignore file, it can match wildcards and should be checked into
the repository. See below for more information about .gitattributes.
Expand Down Expand Up @@ -150,14 +151,9 @@ specifying merely a directory (e.g. `/dir/`) is *not* sufficient to
encrypt all files beneath it.

Also note that the pattern `dir/*` does not match files under
sub-directories of dir/. To encrypt an entire sub-tree dir/, place the
following in dir/.gitattributes:
sub-directories of dir/. To encrypt an entire sub-tree dir/, use `dir/**`:

* filter=git-crypt diff=git-crypt
.gitattributes !filter !diff

The second pattern is essential for ensuring that .gitattributes itself
is not encrypted.
/dir/** filter=git-crypt diff=git-crypt

Mailing Lists
-------------
Expand Down

0 comments on commit 29974b4

Please sign in to comment.