.DS_Store File Prevents Directory Deletion

If you read the ignore docs, you will see this bullet point:

  • A pattern beginning with a (?d) prefix enables removal of these files if they are preventing directory deletion. This prefix should be used by any OS generated files which you are happy to be removed.

So change you ignore from .DS_Store to (?d).DS_Store and deleting dirs on Windows will result in deleted dirs on MacOS if only a .DS_Store file is remaining inside it.

1 Like