Skip to content

Instantly share code, notes, and snippets.

@prashcr
prashcr / git-crypt-unlock
Created January 3, 2020 07:46
Work around a bug in git-crypt
#!/bin/sh
#
# git-crypt-unlock - Work around a bug in git-crypt.
umask 077
for FILE in `find .git-crypt/keys/**/* -type f`; do
if gpg -q --decrypt < $FILE > git-crypt-symmetric-key 2> /dev/null; then
git-crypt unlock git-crypt-symmetric-key
rm -f git-crypt-symmetric-key
echo 'unlocked'