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)
git clone --mirror git@github.com:git_user/project.git
cd project.git
git fetch -q --all -p
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.