# git-crypt

> Transparent file encryption in git

Source: https://talira.ai/catalog/git-crypt-qf6kk0w2
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Command-line tool
- Categories: [security / secrets management / encrypted files](https://talira.ai/categories/security/secrets-management/encrypted-files), [security / encryption](https://talira.ai/categories/security/encryption)
- Platforms: linux, macos, cli[^4]
- Licence: GPL-3.0-or-later[^5][^6]
- Pricing: Free and open source[^5]
- Free tier: yes[^5]
- Self-hostable: yes[^4]
- Creator: Andrew Ayer

git-crypt encrypts chosen files in a [Git](https://talira.ai/catalog/git-ab5bez9f.md) repository when they're committed and decrypts them when they're checked out, so a repository can mix public code with secrets such as keys and credentials. You mark files to encrypt with patterns in `.gitattributes`, and share access by adding collaborators' GPG keys (`git-crypt add-gpg-user`, which commits an encrypted key file) or by exporting a symmetric key. Files are encrypted with AES-256 in CTR mode with a synthetic IV, so the encryption is deterministic and git can still tell when a file changed; people without the key can still clone and commit. Andrew Ayer wrote it, under GPL-3.0 or later; compare [SOPS](https://talira.ai/catalog/sops-c54epjg9.md), which encrypts values inside a file.

## Links

- Website: https://www.agwa.name/projects/git-crypt/
- GitHub: https://github.com/AGWA/git-crypt

## Ways to install

### Package managers

- [Homebrew](https://talira.ai/catalog/homebrew-djy17yn9.md): <https://formulae.brew.sh/formula/git-crypt>[^1]
- [APT](https://talira.ai/catalog/apt-d7essv0z.md): <https://packages.debian.org/stable/git-crypt>[^2]

## Problems it solves

- keep a few secret files encrypted inside an otherwise public git repository
- commit API credentials and private keys to the repo without anyone who clones it being able to read them
- files decrypt automatically on checkout for teammates who have the key, without extra commands each time
- share access to encrypted files in a repo with my team's GPG keys
- developers without the secret key can still clone the repo and commit to it
- encrypt *.key files and a secrets directory in git by pattern, like a .gitignore for encryption
- unlock an encrypted repository in CI with a symmetric key file
- store infrastructure secrets in the same repository as the code that deploys them

## Features

- transparent encryption on commit and decryption on checkout through git filters
- choose files with .gitattributes patterns (filter=git-crypt diff=git-crypt)
- multi-user access with GPG keys: git-crypt add-gpg-user commits a GPG-encrypted key file
- symmetric key mode: git-crypt export-key and git-crypt unlock /path/to/key, no GPG needed
- git-crypt lock to re-encrypt a working copy
- AES-256 in CTR mode with a synthetic IV from an HMAC-SHA1 of the file: deterministic but semantically secure
- degrades gracefully: people without the key can clone and commit

## Limitations

- Doesn't encrypt file names, commit messages or other metadata: only file contents are encrypted[^3]
- No way to revoke access or rotate keys: there's no command to remove a GPG user, and the symmetric key can't be rotated[^3]
- Not suited to encrypting a whole repository: the README recommends git-remote-gcrypt for that[^3]
- Encrypted files aren't stored as deltas: every change stores the whole encrypted file again[^3]
- Windows support is experimental: build it yourself with MinGW, and key files don't get restrictive permissions[^4]

## Capabilities

- Has a command line tool: plan not known

## Trust

Overall: 0.28 out of 1.
Signals: backing 0.20, extensibility 0.20.

- created by Andrew Ayer

Warnings:

- GitHub activity not fetched yet

## Related

- Works with [Git](https://talira.ai/catalog/git-ab5bez9f.md)

## Alternatives

- [Sealed Secrets](https://talira.ai/catalog/sealed-secrets-akz3yepb.md): A Kubernetes controller and tool for one-way encrypted Secrets
- [dotenvx](https://talira.ai/catalog/dotenvx-30gqzg73.md): A secure dotenv, from the creator of dotenv
- [SOPS](https://talira.ai/catalog/sops-c54epjg9.md): Simple and flexible tool for managing secrets

## Sources

[^1]: https://formulae.brew.sh/api/formula.json (checked 21 Nov 2026)
[^2]: https://deb.debian.org/debian/dists/stable/main/source/Sources.xz (checked 21 Nov 2026)
[^3]: https://github.com/AGWA/git-crypt/blob/master/README.md (checked 20 Nov 2026)
[^4]: https://github.com/AGWA/git-crypt/blob/master/INSTALL.md (checked 20 Nov 2026)
[^5]: https://github.com/AGWA/git-crypt/blob/master/COPYING (checked 20 Nov 2026)
[^6]: https://github.com/AGWA/git-crypt/blob/master/git-crypt.cpp (checked 20 Nov 2026)
