The full error message is:
could not symlink /var/lib/gitolite/.gitolite/hooks/common/gitolite-hooked to subdir/myrepo.git/hooks
This happens when I do any changes to gitolite-admin and push these changes. What are these hooks for? Do I need them? What's the problem with the symlink?
I have specified another location for my repositories in $REPO_BASE
, but I made the gitolite user the owner of this path and all repositories using the chown
command so it shouldn't be a permission problem.
Ok, so I found out why this happened. Probably because I'm a noob with Git. The repositories I had put in $REPO_BASE where ordinary repositories, with the actual source code files directly below the "root" directory.
For example, /mnt/data/git/repositories/aproject/Main.cpp
and so on. Turns out I need to have the actual repository under that path, so I did (I might just have been able to use the .git-folder for this, but this is how I did it): git clone --bare aproject.git aproject.git2 && rm -rf aproject.git && mv aproject.git2 aproject.git
.
In short, I did a bare clone of the repository. So now, in /mnt/data/git/repositories/aproject/
we can actually find the "hooks" folder (which the error message complains it cannot find). After a new push of the gitolite-admin repo, all keys were added to authorized_keys and the error message disappeared.
I had this same error, it was a permissions issue.
Make sure that your Project.git is owned by the Git user, not root.
Thought I would share.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With