Project

General

Profile

hot to do git repo autoupdate?

Added by Radek Simcik over 13 years ago

hi

I followed wiki to set up git in redmine. I can see the repository in redmine nicely.

NOW how about the auto update of the local copy that redmine needs after the real one was updated?

I want to use the 'hook method' but I do not know how to use it.

right now user and group rights for redmine git repository are for www-data user.

- does is mean that the 'my_redmine_user' below should be replaced by www-data?
- if yes how can I set up sudo so www-data can run perl?
- could somebody tell me what is the '-p secret' option about?

echo "Post receive-hook => updating Redmine repository"
sudo -u my_redmine_user -p secret perl -we '`cd /redmine/repositories/my_repo.git && git fetch && git reset --soft refs/remotes/origin/master`'

I tried to run 'git fetch' as www-data and got this message: "fatal: Where do you want to fetch from today?" Maybe because there was no change in the repository?

Thank you

Radek


Replies (5)

RE: hot to do git repo autoupdate? - Added by Radek Simcik over 13 years ago

if I run this `cd /redmine/repositories/my_repo.git && git fetch && git reset --soft refs/remotes/origin/master` from the command line it works

if I add it to the hook and go to redmine to list git repos I get this error: The entry or revision was not found in the repository.

do I have to run the sudo part of the update script? The user that executes the script is my git user.

Thank you

R.

RE: hot to do git repo autoupdate? - Added by Radek Simcik over 13 years ago

any idea? anybody got autoupdate working for git?

R.

RE: hot to do git repo autoupdate? - Added by Radek Simcik over 13 years ago

so chmod -R 770 redmine_repo.git did the trick. Now everything works fine.

R.

RE: hot to do git repo autoupdate? - Added by Anonymous about 11 years ago

How to do this on a windows 2008 server if I have a cloned local repository?

    (1-5/5)