I'm new to git, trying to figure out how to have a website updated with each push by doing a checkout to the web root. I have searched stackoverflow and only found topics about how to clone, which is not what i want. So far i have set up my local and remote repos, and a post-receive hook:
#!/bin/sh
GIT_WORK_TREE=/path/to/website/httpdocs git checkout -f
My problem is that the project root folder is included in the checkout... when i push contents to the remote repo, i end up with something like
/path/to/website/httpdocs/project_root/index.php
What i would like to achieve is having
/path/to/website/httpdocs/index.php
How can I omit the project root folder while checking out?