I had to add -O to the scp command on MacOS 15.7. Because I was getting the following error:
% scp -p -P 29418 ubap@gerrit.collaboraoffice.com:hooks/commit-msg .git/hooks/
subsystem request failed on channel 0
scp: Connection closed
This worked:
scp -O -p -P 29418 ubap@gerrit.collaboraoffice.com:hooks/commit-msg .git/hooks/