Open onionjake opened 7 years ago
Yes, please!
This is too transparent as is, I had no idea how to verify success without cloning the repository after push (of fake secrets at first)
I just discovered the git crypt status
command!
That is super useful and deserves a mention in the readme as well. I am sure some users are going to want to manually verify files are encrypted, but git crypt status
probably meets most needs.
Another helpful tidbit. I needed a scriptable method for determining whether a repository is currently locked or not.
I added a file called .is-encrypted to the .gitattributes file.
.is-encrypted just contains:
no
You can then easily script the encryption state:
When repo is unencrypted...
grep -vq 'no' .is-encrypted
echo $?
1
When repo is encrypted...
grep -vq 'no' .is-encrypted
echo $?
0
The readme should encourage you to double check if something is encrypted after writing the .gitattributes file.
You can verify the filter is being matching by doing:
An easier method (assuming you don't have other gitattributes!) I have found is to make sure the hash of the plain file DOES NOT match the hash of the object in the tree:
If you encrypt the file successfully the hashes will not match: