brew install git-crypt
brew install gpg
git init
git-crypt init
- put your credentials into one folder, i.e secretfile
- create a .gitattributes file
mkdir .gitattributes
- add the following text to the body of .gitattributes file
.gitattributes !filter !diff secretfile/** filter=git-crypt diff=git-crypt
git-crypt status -e
git add .
git commit -m 'init commit'
git remote add origin REMOTE_URL
git push master
you can do one of two things:
- Share the encryption key with them (symmetric key).
- Add their GPG key to authorized keys.
git-crypt export-key path/where/key/should/be/saved
git-crypt unlock path/to/key
gpg --gen-key
gpg --list-keys
gpg --export --armor $KEY_ID
gpg --import /path/to/file
git-crypt add-gpg-user --trusted $EMAIL
git-crypt unlock
The decryption is performed with symmetric key uploaded to the Git-crypt unlock
action.
Once all tasks are performed, you can secure the files once again with Git-crypt lock
.