I´m using git for a django webproject. I have a bare git repo on my server and push my commits from my local machine into it. I also have a testserver on my local machine but I would like to have 2 versions of the website on the server. one version as live site (master branch) and one version as testserver (develop branch). So I need 2 working directories.
I would like to use the post-receive hook to
- update my master branch working directory (for the live site on server)
- update my develop branch working directory (for my test site on server)
normally I would do
$ cat > hooks/post-receive
#!/bin/sh
GIT_WORK_TREE=/path/www.example.org git checkout -f
$ chmod +x hooks/post-receive
but GIT_WORK_TREE seems not to be the right choice here I guess? Is there a better way?
how can I define the working directories for branches?