Skip to content

Instantly share code, notes, and snippets.

View Lauro235's full-sized avatar

Lorentz Lauro235

View GitHub Profile
@floydnoel
floydnoel / git-ignore-cleaner.sh
Last active April 27, 2025 09:47
Remove all files from a Git repo based on the .gitignore file
#!/bin/bash
echo "Cleaning up any git ignored files..."
# copy and paste the line below to get the same results as running this script
git rm --cached `git ls-files -ic --exclude-from=.gitignore`
echo "Finished clean up."
# source: https://stackoverflow.com/questions/13541615/how-to-remove-files-that-are-listed-in-the-gitignore-but-still-on-the-repositor/13541721