Last active
December 16, 2015 05:48
-
-
Save hymerman/5386722 to your computer and use it in GitHub Desktop.
Git remove ignored files already added to the repo. This works on windows with msysgit (tested with version 1.8.0.msysgit.0).
Leaves deleted files in place because of --cached.
The key part is the `-z` which makes ls-files use a null character as the delimiter, which works with xargs' -0 option to separate lines without blowing up on paths with …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
git ls-files -i -z --exclude-standard | xargs -0 -r git rm --cached |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment