Created
March 14, 2022 12:14
-
-
Save skounis/d9348b722e0f56cfe852fbe3adca4f98 to your computer and use it in GitHub Desktop.
Git ignore and remove files from the history (cached)
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
# List all the ignored files previously commited | |
git ls-files -ci --exclude-standard | |
# Remove file from Git's history. It keeps it in the file system | |
git rm --cached path/to/file | |
# Remove all the ignored files | |
git ls-files -ci --exclude-standard -z | xargs -0 git rm --cached |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment