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 (

For more information, see

Get git-crypt from GitHub:


$ brew install git-crypt

–OR– [sig]


$ git-crypt init

Edit .gitattributes

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

Add GPG user

$ git-crypt add-gpg-user 6A886CD6

Unlock after clone a repo

$ git-crypt unlock