Skip to content

Instantly share code, notes, and snippets.

View rob-bar's full-sized avatar

Robbie Bardijn rob-bar

View GitHub Profile
#!/bin/bash
cat .gitignore | egrep -v "^#|^$" | while read line; do
if [ -n "$line" ]; then
OLD_IFS=$IFS; IFS=""
for ignored_file in $( git ls-files "$line" ); do
git rm --cached "$ignored_file"
done
IFS=$OLD_IFS
fi