I mean the case you want to develop the same project switching between, say, workstation and laptop at the case you can not use external sync point (sever).
I have thought about (and am going to try) just synchronizing project dirs including .git/, .idea/ and *.iml but excluding target/ and such with, say, SyncThing or similar tool (and, probably it is a good idea to use the same project root dir on both filesystems for such sync).
But what is your way?
P.S. Linux is used everywhere if it does matter.