DEV Community

goffity
goffity

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 --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

Discussion (0)