These answers were a good starting point for me, but non quite worked.
git diff --name-only --diff-filter=ACM main | xargs rubocop --force-exclusio
this adds a filter for added, copied or modified files and forces the exclusion so you don't check files that are ignored in the rubocop.yml