My bash-fu is laughable and this took me days (yes, days!) to put together, so hope it helps.
It uses fswatch which you should have installed and is supposedly cross-platform, but I've only tested it on MacOS (brew install fswatch).
This is my use case:
- I keep my dotfiles in multiple git repos under
~/Dropbox/dotfiles. - I symlink them to wherever they need to be.