Skip to content

Instantly share code, notes, and snippets.

@freemanirl
Created July 21, 2020 12:55
Show Gist options
  • Save freemanirl/6fb2b851363112cfce2d45b34b16d7fb to your computer and use it in GitHub Desktop.
Save freemanirl/6fb2b851363112cfce2d45b34b16d7fb to your computer and use it in GitHub Desktop.
git filter-branch --prune-empty --index-filter 'git log --pretty=format: --name-status | grep -i ^D | cut -f2- | sort -u | xargs git rm -r --cached --ignore-unmatch DoesNotExistInMyProject'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment