I have a website that I’d like to update whenever I push to a remote repository. I am coming from a svn background and still trying to figure out git.
Right now, I have done the following:
- Setup a Git repository on my local machine containing the website.
- Cloned the (bare) repository to my web server.
Now I’m a bit stuck. I can push the changes to my bare repository on the server but I have no idea of how to checkout a working copy of the repository in my www directory and automatically update it whenever I push my local repository to the server. I’ll probably need a hook script right?
Related question, Deploy PHP using Git, partially answers my question, but I’d like to know what the script is actually doing.
This worked for me, it might work for you:
A web-focused Git workflow