git-crypt
Transparent file encryption for Git repositories using AES-256, encrypting files on commit and decrypting on checkout
git-crypt provides transparent file encryption within Git repositories, encrypting specified files when committed and decrypting them when checked out. Files are selected for encryption using .gitattributes patterns, allowing repositories to contain both public and private content. Developers without decryption keys can still clone and commit to repositories containing encrypted files, enabling secure storage of secrets alongside public code.
The tool supports two authentication modes: GPG-based multi-user access through git-crypt add-gpg-user commands that store encrypted keys in the repository, and symmetric key mode using git-crypt export-key for manual key distribution. After initial setup with git-crypt init or unlocking with git-crypt unlock, all encryption and decryption operations happen transparently during normal Git operations.
git-crypt uses AES-256 encryption in CTR mode with synthetic IVs derived from SHA-1 HMACs, providing semantic security under deterministic chosen-plaintext attacks. This approach ensures that while encryption is deterministic (required for Git to detect file changes), it reveals no information beyond file identity. The tool is designed for repositories where most content is public but specific files like API keys or certificates require encryption, rather than full-repository encryption scenarios.
Alternatives & related tools
hunk
Terminal diff viewer for reviewing Git, GitHub, Jujutsu, and Sapling changesets, with inline agent annotations, split/unified layouts, and watch mode.
onefetch
Command-line tool that displays Git repository information and code statistics in terminal
gitoxide
Pure Rust implementation of Git, offered as the gix library crate plus gix and ein command-line binaries for testing the API and running workflow tools.
soft-serve
Self-hostable Git server with SSH-accessible TUI for command-line repository management and browsing.
gh-dash
Terminal UI for GitHub that lists configurable pull request and issue sections, with vim-style hotkeys, custom actions, and a YAML config file.
add a badge to your README
Maintain git-crypt? Show that it's featured on trmn. The badge links back to this page.
[](https://www.trmn.sh/tools/git-crypt?utm_source=badge)<a href="https://www.trmn.sh/tools/git-crypt?utm_source=badge"><img src="https://www.trmn.sh/badge/git-crypt.svg" alt="Featured on trmn" height="20"></a>