Skip to content

Instantly share code, notes, and snippets.

@felipefpx
Created April 27, 2022 03:13
Show Gist options
  • Save felipefpx/3d033af1ed2d7dbfd64fe62a85c82ee7 to your computer and use it in GitHub Desktop.
Save felipefpx/3d033af1ed2d7dbfd64fe62a85c82ee7 to your computer and use it in GitHub Desktop.
Remove file completely from git and history
git filter-branch --force --index-filter \
"git rm --cached --ignore-unmatch *file-path*" \
--prune-empty --tag-name-filter cat -- --all
git push --force --verbose --dry-run
git push --force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment