Definitively delete the tracking of .DS_Store files in GIT

This question already has an answer here:

  • How to make Git “forget” about a file that was tracked but is now in .gitignore?

    15 answers

  • Ignoring an already checked-in directory's contents?
  • Find the most recent commits where two files were identical
  • Emulate git cp, including files with spaces in names
  • Able to push, fetch but not pull
  • Did I create additional branch?
  • find location of git.exe
  • Git cherry-pick syntax and merge branches
  • Why do I sometimes see an “Entry 'filename' not uptodate. Cannot merge.” after a 'git reset --hard' and a 'git pull'?
  • Cannot commit after setting editor
  • Using git-remote-hg on windows
  • How to switch submodule branch based on superproject branch
  • Git: How to ignore a file from one repo and add it to another?
  • 2 Solutions collect form web for “Definitively delete the tracking of .DS_Store files in GIT”

    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"

    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
    Git Baby is a git and github fan, let's start git clone.