Skip to content

Instantly share code, notes, and snippets.

@pestilence669
Created September 16, 2016 22:37
Show Gist options
  • Save pestilence669/c6aa2b18067db7687ae6cf059b372d94 to your computer and use it in GitHub Desktop.
Save pestilence669/c6aa2b18067db7687ae6cf059b372d94 to your computer and use it in GitHub Desktop.
p4 obliterate (for Git)
#!/bin/bash
#
# run from the project's root with the full relative path to the file
# to destroy from history.
#
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