The problem with your regex is that the full path of the file gets matched, not only the directory (basename). Thus you cannot filter out the .git directory itself.
This means you can use positive matches only.
Using a character class negation ([^.][^g][^i][^t]) does also not help because there are parts of the path that do match this regex, so the path matches anyway.
You could use Phar::buildFromIterator and then use RecursiveFilterIterator to filter out the files.
There you can define your own matching method that filters correctly.