Gogs to host my php git website


#1

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?


#2

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

#!/bin/bash
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