There are projects, like for Node there's a dotenv package, that can load these files.
If I have multiple machines, I manually sync them since that's usually the easiest way to manage it as secrets in my experience don't change enough to warrant syncing them.