Skip to content

Instantly share code, notes, and snippets.

@donnib
Last active September 9, 2015 06:59
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 donnib/0699b2475f0ac748f1e2 to your computer and use it in GitHub Desktop.
Save donnib/0699b2475f0ac748f1e2 to your computer and use it in GitHub Desktop.
git filter-branch -f --index-filter 'xargs git rm --cached -r < /home/folders_to_delete.txt --ignore-unmatch' --prune-empty --tag-name-filter cat -- --all
--index-filter 'while read -r dir; do git rm --cached -r --ignore-unmatch "$dir"; done < /home/folders_to_delete.txt'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment