Skip to content

docs: autocrlf on windows #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ Configure a repository to use git-crypt:

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
secretfile eol=lf filter=git-crypt diff=git-crypt
*.key eol=lf filter=git-crypt diff=git-crypt
secretdir/** eol=lf filter=git-crypt diff=git-crypt

***eol=lf settings is necessary if autocrlf is true.***

Like a .gitignore file, it can match wildcards and should be checked into
the repository. See below for more information about .gitattributes.
Expand All @@ -40,6 +42,9 @@ Make sure you don't accidentally encrypt the .gitattributes file itself
.gitattributes rules are in place *before* you add sensitive files, or
those files won't be encrypted!

***IF `core.autocrlf` is true (which is recommended in Windows), it will throw an error like `git-crypt: error: encrypted file has been tampered with!`
To avoid this, use `eol=lf` in .gitattributes for the secrets.***

Share the repository with others (or with yourself) using GPG:

git-crypt add-gpg-user USER_ID
Expand Down
Loading