#!/bin/sh
while read oldrev newrev ref
do
if [[ $ref =~ .*/master$ ]];
then
echo "Master ref received"
git --work-tree=/[рабочий каталог]/ --git-dir=/[каталог с репозиторием].git checkout -f
else
echo "Only the master branch may be deployed on this server."
fi
done