- Installed
git-crypte.g. via homebrew (brew install git-crypt) or nix (nix-env -iA nixpkgs.git-crypt).
- Setup repo
- run
git-crypt init-> creates.git-cryptfolder in.git - add
.gitattributesfile and add files to be encrypted - now changes on encrypted files are encrypted automatically and transparent to the user
- extract the key from the repo with
git-crypt export-key <keyfile> - store the keyfile in a safe place and share it with collaborators
Adding collaborators to the repo can be done in two ways:
- add collaborators to the repo with their own gpg key
- share one key with all collaborators (poor practice but easier to manage and probably sufficient for small teams)
- clone repo
- get the keyfile from the repo owner
- run
git-crypt unlock <keyfile>-> decrypts all files in the repo - From now on changes to encrypted files are encrypted automatically and transparent to the user
For testing purposes the keyfile is stored in the repo (./secret_key_for_test/exported_secret_key). Of course you should never do this in a real project.