10

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
  • 67,326
  • 35
  • 140
  • 172
Luca Reghellin
  • 6,624
  • 10
  • 65
  • 108

2 Answers2

13

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
  • 67,326
  • 35
  • 140
  • 172
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
  • 24,347
  • 2
  • 47
  • 89