Skip to content

Instantly share code, notes, and snippets.

@mdyzma
Created September 18, 2018 19:47
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 mdyzma/8c3250d90ac87458a9f7e2869dd6e8bd to your computer and use it in GitHub Desktop.
Save mdyzma/8c3250d90ac87458a9f7e2869dd6e8bd to your computer and use it in GitHub Desktop.
#!/bin/bash
cat .gitignore | while read line
do
if [[ $line == *#* ]]
then
echo #skip
else
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch '"$line" --prune-empty --tag-name-filter cat -- --all
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment