Skip to content

Instantly share code, notes, and snippets.

@prashcr
Created January 3, 2020 07:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prashcr/834b8ef2023198068e708e3dc6a15a7f to your computer and use it in GitHub Desktop.
Save prashcr/834b8ef2023198068e708e3dc6a15a7f to your computer and use it in GitHub Desktop.
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'
exit 0
fi
done
echo 'could not unlock'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment