Created
August 31, 2016 10:41
-
-
Save j796160836/eca9c3553769549be942858cbdcfc847 to your computer and use it in GitHub Desktop.
Strip out files defined in .gitignore on git repo
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/bash | |
# Referance: http://stackoverflow.com/questions/13541615/how-to-remove-files-that-are-listed-in-the-gitignore-but-still-on-the-repositor | |
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