I've added .DS_Store to the .gitignore file, but it seems that it is only ignoring .DS_Store in the root directory, not in every folder and subfolder.
How do I fix this?
I've added .DS_Store to the .gitignore file, but it seems that it is only ignoring .DS_Store in the root directory, not in every folder and subfolder.
How do I fix this?
You can also add the
--cached
flag to auco's answer to maintain local .DS_store files, as Edward Newell mentioned in his original answer. The modified command looks like this:find . -name .DS_Store -print0 | xargs -0 git rm --cached --ignore-unmatch
..cheers and thanks!Step :1)Remove the existing files using this command
find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch
Step : 2)Add .DS_Store in your .gitignore file
Step :3) Commit your changes in .gitignore git add .gitignore git commit -m "removed .DS_Store"