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 (agwa@andrewayer.name).

For more information, see https://www.agwa.name/projects/git-crypt.

Get git-crypt from GitHub: https://github.com/AGWA/git-crypt


–OR–


$ brew install git-crypt


–OR–


git-crypt-master-20160730.zip [sig]

Init

$ git-crypt init

Edit .gitattributes

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

Add GPG user

$ git-crypt add-gpg-user 6A886CD6

Unlock after clone a repo

$ git-crypt unlock