Skip to content

Instantly share code, notes, and snippets.

@neilk
Last active February 16, 2017 17:59
Show Gist options
  • Save neilk/e00b56d6fdfbbfa41c9505ddccd70d2c to your computer and use it in GitHub Desktop.
Save neilk/e00b56d6fdfbbfa41c9505ddccd70d2c to your computer and use it in GitHub Desktop.
Purge a file from your git repo
#!/bin/bash
git filter-branch --force --index-filter \
"git rm -r --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