I want to be able to execute a php hook on post-receive hook, to copy files from the git repo to web folder on the same server and only run if it was pushed was made on a master branch ignoring other branches. Below is what I've got so far.
!/usr/bin/php
<?php
exec("git archive master | tar -x -C /var/www/", $output);
?>
Basically, im not sure how to access git arguments using php.