I have a website that I am setting up that I want to use git for version control. My idea is to create a beta subdomain where I can test the site and then 'push' it to the main site in the public_html folder. Everything needs to be on the server to access the database. I tried to actually clone the main site into the beta folder but I receive the following error when trying to push to the main site.
remote: error: By default, updating the current branch in a non-bare repository denied
I tried to use a bare repo but that is no good for a website as it does not contain a working tree.
Is there a better way to do this?