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

Windows XP installation, no previous version of Windows NT - Super User

software installation - How to install linux driver for a lb-link wireless usb adapter - Ask Ubuntu

permissions - Mount is denied because the NTFS volume is already exclusively opened - Ask Ubuntu