I don't understand why answers to "How do I recursively do .... in my repo" questions don't mention `git ls-files` more instead of find.
Do yourself a favour and use `git ls-files` or `git ls-files -z` etc in such situations. It will only operate on the files known by git and not on the files of the build system nor on the `.gilt/*` files.
(`hg files` for #mercurialists)
chaos.social – a Fediverse instance for & by the Chaos community