Read our latest blog posts, learn something new, find answers, and stay up to date.

Fix Permissions Error with Redmine GitHub Hook

For years we have used svn and are in the process of migrating all of our repositories to git. Part of this migration process was then setting up a webhook within Github to then update our local repositories in Redmine when a change was pushed. In order to handle that – I installed and configured the Redmine GitHub Hook plugin. When testing out the initial webhook – I kept getting the following error:
GithubHook: Command 'git fetch origin' didn't exit properly. Full output: ["error: cannot open FETCH_HEAD: Permission denied\n"]

In order to fix that error – there is another step needed in the set up process documented in Redmine GitHub Hook plugin Readme (Step 2: Add the repository to Redmine)

If you get the same error after following this step: HowTo keep in sync your git repository for redmine try this:

chmod 777 -R project.git

The entire process would then be:
(Note: In the below examples, “git_user” and “project.git” should be modified for your GitHub project)

  1. git clone --mirror
  2. cd project.git
  3. git fetch -q --all -p
  4. chmod 777 -R project.git (make sure you are have moved outside of the project.git directory first)

That will then update as need without giving the permission denied error.