Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gitolite gives error message when pushing gitolite-admin: could not symlink

Tags:

git

gitolite

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.

like image 541
joscarsson Avatar asked Aug 13 '11 08:08

joscarsson


2 Answers

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.

like image 106
joscarsson Avatar answered Sep 23 '22 16:09

joscarsson


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.

like image 20
Nick Woodhams Avatar answered Sep 24 '22 16:09

Nick Woodhams