There's a handy 'cloud' enabled saves storage script posted by one of the forum users - https://retropie.org.uk/forum/topic/18712/script-setup-script-to-sync-saves-to-cloud-services. You can maybe adapt it for your needs; it's based on rclone(rclone.org).
Other than that, git would be easy to implement, but it's a bit overkill for this purpose - unless you'd like to have a versioning system in place. A simple rsync script would suffice.
As for the file types, I guess you'll have to think if you want to synchronize:
save states (*.state[X])
memory saves (*.srm)
artwork/gamelistst (media folder and/or gamelist.xml).