From https://www.silentorbit.com/notes/2013/rsync-by-extension/
Having a file structure full of various file types you want to sync only files of one type into a new location.
rsync -rv --include '*/' --include '*.js' --exclude '*' --prune-empty-dirs Source/ Target/
This will generate the same structure found in Source into Target but only including the JavaScript(.js) files.