+1
Daily
9,995
stars
554
forks
85
watchers
87
prs
222
issues
2
releases
README
git-crypt - transparent file encryption in git ============================================== git-crypt enables transparent encryption and decryption of files in a git repository. Files which you choose to protect are encrypted when committed, and decrypted when checked out. git-crypt lets you freely share a repository containing a mix of public and private content. git-crypt gracefully degrades, so developers without the secret key can still clone and commit to a repository with encrypted files. This lets you store your secret material (such as keys or passwords) in the same repository as your code, without requiring you to lock down your entire repository. git-crypt was written by Andrew Ayer ([email protected]). For more information, see . Building git-crypt ------------------ See the INSTALL.md file. Using git-crypt --------------- Configure a repository to use git-crypt: cd repo git-crypt init 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. Make sure you don't accidentally encrypt the .gitattributes file itself (or other git files like .gitignore or .gitmodules). Make sure your .gitattributes rules are in place before you add sensitive files, or those files won't be encrypted! Share the repository with others (or with yourself) using GPG: git-crypt add-gpg-user USER_ID USER_ID can be a key ID, a full fingerprint, an email address, or anything else that uniquely identifies a public key to GPG (see "HOW TO SPECIFY A USER ID" in the gpg man page). Note: git-crypt add-gpg-user will add and commit a GPG-encrypted key file in the .git-crypt directory of the root of your repository. Alternatively, you can export a symmetric secret key, which you must securely convey to collaborators (GPG is not required, and no files are added to your repository): git-crypt export-key /path/to/key After cloning a repository with encrypted files, unlock with GPG: git-crypt unlock Or with a symmetric key: git-crypt unlock /path/to/key That's all you need to do - after git-crypt is set up (either with git-crypt init or git-crypt unlock), you can use git normally - encryption and decryption happen transparently. Current Status -------------- The latest version of git-crypt is 0.8.0, released on 2025-09-23. git-crypt aims to be bug-free and reliable, meaning it shouldn't crash, malfunction, or expose your confidential data. However, it has not yet reached maturity, meaning it is not as documented, featureful, or easy-to-use as it should be. Additionally, there may be backwards-incompatible changes introduced before version 1.0. Security -------- git-crypt is more secure than other transparent git encryption systems. git-crypt e
Top issues
#47Add `del-gpg-user` to delete (and re-encrypt) repository36 comments · 2015-03-25#105`git worktree add` in repo with encrypted commited file made encrypted fails.20 comments · 2017-01-05#39Add `list-gpg-user`command to list all added users18 comments · 2015-02-24#69please add subcommand to determine lock state17 comments · 2015-10-15#62'git-crypt status' with the '-f' option to stage an encrypted version fails for me?16 comments · 2015-09-23#22Windows support15 comments · 2014-06-26#298git-crypt can't handle utf-813 comments · 2023-09-08#137remove git-crypt from a repository13 comments · 2017-11-27
Discussions
#329Thanks for maintaining this awesome project0 comments · 2025-09-24#323Who can add a gpg key?1 comments · 2025-05-24#301Unlocking with new key1 comments · 2024-01-14#295Git-crypt - Set up on Windows0 comments · 2023-07-13#283Automatic locking when leaving directories0 comments · 2023-03-27#281static compile git-crypt0 comments · 2023-03-07#280Question about .git-crypt directory0 comments · 2023-03-02#279newbie question: Must .git-crypt directory in a repository be committed and not be encryted.0 comments · 2023-02-23
Latest release
0.8.0 0.8.0 2025-09-24Remove OpenSSL 1.0 support, fix compilation with OpenSSL 3. Avoid use of problematic short GPG key IDs.