Synchronizing git repository with post-receive hook

Posted by eliocs on Super User See other posts from Super User or by eliocs
Published on 2010-12-31T00:19:48Z Indexed on 2010/12/31 0:57 UTC
Read the original article Hit count: 548

Filed under:
|

Hello,

I have a redmine server and a gitolite server on the same machine. I want Redmine's GIT repository to get updated when a commit is registered. I thought of adding a post-receive script that updates the repository:

post-receive:

cd home/redmine/repositories/repo
git pull

this doesn't work because the script is run by the gitolite user instead of the redmine user owner of the repository cloned folder. How can I change the user that executes the script inside a batch script?, is there a cleaner way of updating the repository?

thanks in advance.

© Super User or respective owner

Related posts about git

Related posts about redmine