开发者

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

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 repositor开发者_开发知识库ies 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.


This is either a permission issue (which you say it shouldn't be), or a chmod (access) issue.
To be extra sure, you can edit your question with the "ls -alrt' of both directories.
If it fails during the new repos declaration, it will keep trying to declare them at each new push.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜