Skip to content

Instantly share code, notes, and snippets.

@beenotung
Last active September 13, 2023 15:41
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 beenotung/1937420abe4ee5519a4ffb5161ac2b62 to your computer and use it in GitHub Desktop.
Save beenotung/1937420abe4ee5519a4ffb5161ac2b62 to your computer and use it in GitHub Desktop.
remove file from git completely
#!/bin/bash
set -e
set -o pipefail
FILTER_BRANCH_SQUELCH_WARNING=1 git filter-branch --force --index-filter "git rm --cached --ignore-unmatch $@" --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