#!/bin/sh
#
# git-rm-from-history - remove sensitive data from git history
#
# ---
# see: https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History

git filter-branch --force \
  --index-filter "git rm -r --cached --ignore-unmatch $*" \
  --prune-empty --tag-name-filter cat -- --all
