How to set Server Side Git Hook to give permission in master branch to certain user names? - Ask Ubuntu


i have git server. not gitlab or similar, bare git server. wanted create git hook decline push on master branch users. tried below one.

#!/bin/bash if [ "$1" == refs/heads/master ];     cemail=$(git log -1 --format=format:%ce head)      echo $cemail      if [ "$cemail" != fahad@domain.com ] && [ "$cemail" != jake@domain.com ];             echo "-----------------------------------------------------"         echo "warning: not allowed push in master branch !"         echo "-----------------------------------------------------"         exit 1     fi fi 

users without above email should not able push on master branch. not working expected. can guys please guide me ?

update: when (fahad@domain.com) allow me push branch. , if ask else push branch other me , jake, allows too. picks last users email.


Comments

Popular posts from this blog

download - Firefox cannot save files (most of the time), how to solve? - Super User

windows - "-2146893807 NTE_NOT_FOUND" when repair certificate store - Super User

sql server - "Configuration file does not exist", Event ID 274 - Super User