# filter directory based on .gitignore file
--filter=":- .gitignore"

# exclude .git folder
--exclude='/.git'

# run rsync as sudo
--rsync-path="sudo rsync"

# Run rsync as sudo with gitignore and exclude .git folder 
rsync -avz --filter=":- .gitignore" --exclude='/.git' --rsync-path="sudo rsync" LOCAL_FOLDER IP_SERVER:REMOTE_FOLDER

# Run rsync as sudo with multiple paths
rsync -avz -r --files-from=paths.txt --filter=":- .gitignore" --exclude='/.git' --rsync-path="sudo rsync" mekoworks-ecs:/ .