Skip to content

Instantly share code, notes, and snippets.

@albertlieyingadrian
Created August 11, 2022 07:29
Show Gist options
  • Select an option

  • Save albertlieyingadrian/395061d59329d55ee9ff0e284cba87c1 to your computer and use it in GitHub Desktop.

Select an option

Save albertlieyingadrian/395061d59329d55ee9ff0e284cba87c1 to your computer and use it in GitHub Desktop.
Git remove file from history
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch <path to the file or directory>' --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