Reputation: 9847
Sorry for the dumb question, but I haven't managed to understand how. I have a local repo and a remote repo on the server, both are Ubuntu. I'ts all okay, commits work over SSH, but how do I force the remote server into publishing the repo into /var/www ?
Upvotes: 1
Views: 63
Reputation: 9847
This is how I solved the problem:
I configured the local repository
I created a bare repository on the remote server
git init --bare
I've taken the necessary steps to configure committing to the remote repo
I added a post-receive hook under the hooks folder of my remote repository
/path/to/repo/hooks/post-receive:
#!/bin/sh
GIT_WORK_TREE=/var/www/www.example.org git checkout -f
Then I chmod
-ded it:
chmod +x /path/to/repo/hooks/post-receive
Upvotes: 4