Patch #2173
openUpdate the Git repository automatically
0%
Description
The Wiki suggests (http://www.redmine.org/wiki/redmine/RedmineRepositories) that you should set up a cron job to update the Git bare repository, the one redmine points to, automatically. This is unneccessary since you could just as easily use Git's hooking mechanism to have it automatically update the repo on each push.
1. chmod a+x post-receive-redmine
2. Put post-receive-redmine in <redmine dir>/doc/git-hooks
3. Change into your main git repo dir (the one you push to)
4. Edit ./hooks/post-receive and add a line that says ". <redmine dir>/doc/git-hooks/post-receive-redmine"
5. Run "git config --add hooks.redmineGitBase <base path to redmine bare repos, i.e. /var/lib/redmine/git_repos>"
6. You're done!
The script could be updated to create the bare repo if it doesn't already exist but it would need to know which permissions to change it to for redmine to read it so I didn't add this feature.
Files
Related issues