Using GIT to deploy website

It is possible to write a post-update hook which detect the branch name.
See for inspiration:

As an example (all those hooks are based on git rev-parse):

#!/bin/bash
while read oldrev newrev refname
do
    branch=$(git rev-parse --symbolic --abbrev-ref $refname)
    if [ "master" == "$branch" ]; then
        # Do something
    fi
done

Leave a Comment