This happens to me all the time. I forget to add a .gitignore to my git repo and then I start creating a bunch of folders for my project. A few clicks later, I'm suddenly inundated with a bunch of hidden .DS_Store files.

Here's the command to get rid of all the .DS_Store files within a hierarchy of folders.

Change Directory into your project folder

cd /path/to/your/project/folder

Recursively find any file with .DS_Store and delete it.

find . -name '.DS_Store' -type f -delete