Skip to content

Instantly share code, notes, and snippets.

@ralt
Created February 3, 2016 16:45
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 ralt/bf76b2805b3576b41583 to your computer and use it in GitHub Desktop.
Save ralt/bf76b2805b3576b41583 to your computer and use it in GitHub Desktop.
git shred - burn a file with fire
#!/bin/bash
if [ ! -z "$1" ]; then
echo "$1 doesn't exist."
exit 1
fi
git filter-branch --force --index-filter \
"git rm --cached --ignore-unmatch $1" \
--prune-empty --tag-name-filter cat -- --all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment