TIL how to make MacOS behave on network shares

How do you know there is a MacOS user amongst your colleagues? That has to be when you start to realize that half your folders in your network shares are gifted with a pesky .DS_Store file. Those files can even spread to your repositories by the way… All it takes is 1 single person to create a lot of nuisance for everyone else.

But hey, MacOS does what it does, and this is just something we have to live with. Right? This is what I thought for so many years.

But this is actually wrong. MacOS users: there is a way to for you to behave on network shares, and there has been for a long time! What you need is this simple command line (and a logout):

defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE

It can even speed up your browsing on network shares! Don’t thank me.