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"