Consider this: (untested)
rsync --include=.gitignore
This is what the man page says, although the git ignore file is a bit more advanced, giving you the ability to comment out lines and βignore ignored filesβ that this command does not comply with.
How complex is your .gitignore file, and most importantly ... does it ignore the .gitignore file?
source share