Skip to content

Instantly share code, notes, and snippets.

@asquelt
Created July 3, 2015 13:30
Show Gist options
  • Save asquelt/b981eef481fc912969da to your computer and use it in GitHub Desktop.
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
#!/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