DEV Community

Goffity Corleone
Goffity Corleone

Posted on • Updated on

Git remove files from ignore lists.

Command to remove files from the ignore list.

git rm --cached `git ls-files -i --exclude-from=.gitignore`
Enter fullscreen mode Exit fullscreen mode

on MacOS

git ls-files -i -c --exclude-from=.gitignore | xargs git rm --cached
Enter fullscreen mode Exit fullscreen mode

Reference:
https://stackoverflow.com/questions/13541615/how-to-remove-files-that-are-listed-in-the-gitignore-but-still-on-the-repositor

Top comments (0)