17

I have a new repo and before I perform the first commit I'd like to ignore .DS_Store files.

I've tried adding the following to the .gitignore file via Tower:

.DS_Store
*.DS_Store
*/.DS_Store

But only the .DS_Store file at the root is ignored, all others are included ready for commit.

Is there a trick to getting these files to be ignored?

CMSCSS
  • 2,076
  • 9
  • 28
  • 49

2 Answers2

18

**/.DS_Store

try it out :) Hope it help

Alex G
  • 1,321
  • 1
  • 24
  • 31
13

Make sure you didn't add to the index those DS_Store first.

If you did, check out "How Can I Remove .DS_Store Files From A Git Repository?", and then check if your .gitignore works.
Use git rm --cached if you want just to remove then from the index while keeping them in the working tree.

Note: only .DS_Store should be enough in your case.

See Objective-C.gitignore from the GitHub Collection of Useful .gitignore Templates.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks for that, I hadn't added them to the repo because I hadn't done the first commit. IN the end I just gave up and committed them. – CMSCSS Apr 30 '13 at 21:24