Gogs to host my php git website


I have gogs on my server.
I want to host a php website on my server using git + gogs to submit changes. Right now I can’t do that because my gogs repo’s in the server are bare repo’s, so it doesn’t have the files (or working tree) on the server.
How can I create/submit changes to my php website using gogs and my website be able to be hosted on my server?


Just need to put this on post-receive hook (ajust your path according to your project):

git --work-tree=/var/www/alexurquhart.com/ --git-dir=/home/git/gogs-repositories/alex/alexurquhart.com.git checkout -f

And be sure that gogs user has write permission to both directory paths