Is there a way to disable
git commit when the server time reaches 11am and re-enable when it reaches 2pm?
Or disable git push to all but a select number of users
Wow you are going to rewrite the whole binary!?!? How about you replace /usr/bin/git with a script instead, and have the script deny commits based on server time.
The "not commit" is not possible in a secure way, so whatever you choose the user 'can' bypass it!
a) the "pre-commit hook" in git.
Or are you looking for remote repos with permissions & co? Check out
I haven't tested this, but what happens if you remove write permission of git's repo folders to the users and groups which effectively do the change? I guess git will complain somehow and tell the user it cannot execute the command successfully, but pulling and checkout should still be possible.
The correct user, of course, depends on the way how the repo is accessed. In case of push over http this might be the webserver's user and group which is, e. g., called www-data on my Debian with Apache.