42

In this case I want to ignore the files iOS uses, and in particular this file

.DS_Store

I created a .gitignore file as such

touch .gitignore

and put in a single line

/.DS_Store

I push to a bare repo which has a hook to checkout to a full repo.

The file keeps showing up in my full repo.

cade galt
  • 3,843
  • 8
  • 32
  • 48

2 Answers2

57

You can also remove committed .DS_Store files like this: git rm --cached .DS_Store

CroMagnon
  • 1,218
  • 7
  • 20
  • 32
wasddd_
  • 937
  • 2
  • 10
  • 19
34

As you mentioned in your comment, you've already committed the .DS_Store file. To fix this, just remove the file and make a commit. Then, as long as you have your .gitignore file set up and stored in your repo, you shouldn't see any more problems with .DS_Store files.

taylorc93
  • 3,676
  • 2
  • 20
  • 34