Created
June 20, 2011 21:41
-
-
Save xdissent/1036653 to your computer and use it in GitHub Desktop.
Git post-receive hook to update Redmine changesets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Add this hook to /usr/share/git-core/templates/hooks to enable for all new repositories. | |
REPO_URL=`echo $PWD | sed 's:/hooks$::'` /usr/share/redmine/script/runner /usr/share/redmine/extra/update_repository.rb -e production > /dev/null 2>&1 & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add this code to /usr/share/redmine/extra/update_repository.rb | |
r = Repository.find_by_url(ENV['REPO_URL']) | |
r.fetch_changesets unless r.nil? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oh, and now you can turn "Auto-fetch Commits" off in Redmine's settings.