25/04/2024
git-crypt headache
Just a quick tip to remind myself how to properly commit some data that needs to be encrypted with git-crypt.
First of all, if you need to change files pattern or paths of the data you need to encrypt you have to change your .gitattributes file:
- git clone the encrypted repo
- modify .gitattributes
- git add & git commit
- git push
In case you only have to change encrypted files or add new encrypted files
- git clone the encrypted repo
- unlock it with “git-crypt unlock <key path>”
- verify files are not crypted with “git-crypt status ; file <encrypted files path>”.
If they’re shown as “data” it means they’re still encrypted (unless they’re binary data by themself) - add/change files
- git add & git commit
- git-crypt lock
- verify files are encrypted before pushing repo with “git-crypt status ; file <encrypted files path>”
- git push
After all this you can blame yourself for turning one more simple thing into a hard one.