Skip to content

Instantly share code, notes, and snippets.

@scorsi
Created May 29, 2019 16:18
Show Gist options
  • Save scorsi/09ac3e723c644457ce328aa182ca9272 to your computer and use it in GitHub Desktop.
Save scorsi/09ac3e723c644457ce328aa182ca9272 to your computer and use it in GitHub Desktop.
Remove files from a git repository which are present in .gitignore
git ls-files -i --exclude-from=.gitignore | xargs git rm --cached
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment