Reputation: 2205
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?
Upvotes: 0
Views: 86
Reputation: 7064
I think you can use the "git post-receive hook".
On server, you have to use two repositories:
On the bare repository, you configure the post-receive-hook: when the repository is updated, you can automatically perform an update of the clone repository to update your website.
Upvotes: 1