I have some git repositories accessed remotely through SSH and I want to make some of them read-only to prevent more pushes. Some people have remotes pointing to these repos
Inspired by this comment:
Update your hooks/pre-receive file with the following content:
hooks/pre-receive
#!/bin/sh echo "Closed for all pushes" ; exit 1
This way, all users trying to push changes to this repo will receive the message above and the push will be rejected.