DEV Community

Goffity Corleone
Goffity Corleone

Posted on • Edited on

3 1

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)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay