12

I've a git repo where .DS_Store files are already tracked. Is there a way to completely ignore theme in every folder?

I know that before being tracked I can simply put .DS_Store in .gitignore, but I also know that it doesn't work if .DS_Store are already versioned.

Anshul Goyal
  • 73,278
  • 37
  • 149
  • 186
Luca Reghellin
  • 7,426
  • 12
  • 73
  • 118

2 Answers2

17

You need to remove them from the repo using git rm and then commit the changes.

git rm --cached "*.DS_Store"
git commit -m "remove all .DS_Store"
Anshul Goyal
  • 73,278
  • 37
  • 149
  • 186
0

You need to remove them in some way or another, using git rm. Of course, this may be easier than going through them manually:

find -name .DS_Store -print0 | xargs -0 git rm
Dolda2000
  • 25,216
  • 4
  • 51
  • 92