Why is git-crypt not encrypting my files?
We must git-crypt unlock
the repository first for git-crypt
to encrypt the file for us upon commit.
A pre-commit hook to avoid accidental commit of sensitive data:
#!/bin/sh
#pre-commit
git-crypt status | grep "WARNING"; test $? -eq 1 # edited
Credit: https://www.gitmemory.com/issue/AGWA/git-crypt/45/614607121
Note that the pre-commit hook file must be set to executable, e.g. chmod 744 .git/hooks/pre-commit