Skip to content

Instantly share code, notes, and snippets.

@vladris
Created January 3, 2019 00:40
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 vladris/2587917a975e243f62d143e102a33b9b to your computer and use it in GitHub Desktop.
Save vladris/2587917a975e243f62d143e102a33b9b to your computer and use it in GitHub Desktop.
Prune already deleted files from git history
git log --diff-filter=D --name-only --pretty="format:" > ..\FILES
for /f "tokens=*" %%a in (..\FILES) do (
git filter-branch --tag-name-filter cat --index-filter "git rm -r --cached --ignore-unmatch %%a" --prune-empty -f -- --all
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment