Created
July 3, 2015 13:30
-
-
Save asquelt/b981eef481fc912969da to your computer and use it in GitHub Desktop.
a quick script to remove all encryption from git repo; run: git filter-branch --tree-filter '/tmp/unencrypt-tree' deadbeef..HEAD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
i=1 | |
log=$(mktemp /dev/shm/unenc.XXXXXXX) | |
find -type f -name \*.gpg|while read f ; do | |
out=$(mktemp /dev/shm/unenc.XXXXXXX) | |
[ $i -gt 1 ] && ec"o -n " | |
gpg <$f >$out 2>/dev/null | |
if [ -s $out ] ; then | |
mv $out $f | |
echo -n "[$f]" | |
echo "$f" >>$log | |
fi | |
rm -f $out | |
printf -v counter "(%05d)" $i | |
echo -n "$counter" | |
i=$((i+1)) | |
done | |
[ -s $log ] && echo | |
rm $log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment