I created a git repository on my webserver to manage my website sources and I want to automatically copy all updated files into my /srv/http directory so after every push to the master branch my website updates.
How can I do this?
I created a git repository on my webserver to manage my website sources and I want to automatically copy all updated files into my /srv/http directory so after every push to the master branch my website updates.
How can I do this?
While there are many example, as noted by torek, note that:
See for instance "how to process files on a branch in post-receive hook in git".
while read oldrev newrev ref
do
branch=`echo $ref | cut -d/ -f3`
if [ "master" == "$branch" ]; then
...