Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save awmpietro/596c27a26306f1bf690f303b48b66a07 to your computer and use it in GitHub Desktop.

Select an option

Save awmpietro/596c27a26306f1bf690f303b48b66a07 to your computer and use it in GitHub Desktop.
how to delete files permanently from your local and remote git repositories
git filter-branch -f --index-filter "git rm -rf --cached --ignore-unmatch FOLDERNAME" -- --all
rm -rf .git/refs/original/
git reflog expire --expire=now --all
git gc --prune=now
git gc --aggressive --prune=now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment