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

  • Git: committing a symlink to a folder
  • Add git repository to existing folder on VSP
  • Using multiple Git repos inside folder with same top level parent directory?
  • git workflow with main svn repository using git-svn
  • GitHub keeps throwing “Could not commit submodules” error, and I don't see why that is. Any ideas?
  • Cloning git repo causes error - Host key verification failed. fatal: The remote end hung up unexpectedly
  • How to start git daemon on Windows
  • How to uncommit a commit after many commits have been added?
  • Why Github doesn't show my contributions even though I added my email address?
  • Amend the second to last commit
  • Git. Merging changes from one file to another files WITHIN the same branch
  • Using svn/git with Xcode
  • 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.