Filter/omit .git directory when copying

I have a small context-menu function called "Copy to Destination". As expected, I use it to:

  • right click on a folder or file
  • and copy the contents of the folder or file to the adjacent file display panel.

but when I invoke it, I would like it to not copy any files with extensions of ".ini" and also not copy any files within a .git directory (if one exists).

My function looks like this:

@keydown:none
Copy FILTER ~(*.ini|.git)
@keydown:shift
Copy AS

But it still copies the .git directory if one exists.

Any thoughts on what I'm doing wrong?

Thank you.

Use a sub-folder filter to exclude everything below a directory: