3

I have looked at this and this which both describe similar problems but don't offer solutions to my problem. However, Gitolite only started doing this last night and I'm not sure what caused it. Here are the errors I'm getting:

git@server:/path/to/cloned/repo/$ git push
Counting objects: 7, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 374 bytes, done.
Total 4 (delta 2), reused 0 (delta 0)
Unpacking objects: 100% (4/4), done.
remote: ENV GL_RC not set
remote: BEGIN failed--compilation aborted at hooks/update line 20.
remote: error: hook declined to update refs/heads/master
To /home/git/repositories/git-repo-name.git/
 ! [remote rejected] master -> master (hook declined)
error: failed to push some refs to '/home/git/repositories/git-repo-name.git/'

Now what is strange is that Gitolite only started complaining now. It has worked fine for the last week or so.

Community
  • 1
  • 1
dsavi
  • 1,723
  • 3
  • 12
  • 8
  • 1
    Were there any updates on the machine running gitolite? Did you have the message `ENV GL_RC not set` when it was still working? – fge Jan 12 '12 at 12:33
  • Nope, no updates. The error only appeared now. – dsavi Jan 12 '12 at 12:55
  • I just noticed that you had the remote completely wrong... See my answer – fge Jan 12 '12 at 13:09

1 Answers1

3

This is not the way to use gitolite. Your remote is /home/git/repositories/git-repo-name.git/, which means gitolite is on your own machine.

The remote should be git@localhost:git-repo-name.

Add your own public SSH key to the gitolite-admin repo, fill in gitolite.conf correctly, change your remote (by editing your .git/config) and try again.

And note that you should also have cloned gitolite-admin using git@localhost:gitolite-admin.

fge
  • 119,121
  • 33
  • 254
  • 329
  • This worked for my local machine, but I also need to have a clone of it on the machine that hosts the repo. When I try to clone it there, this happens (Using the exact same command as on my local computer): `git@server:~/test$ git clone git@server:git-repo-name Initialized empty Git repository in /working/directory/.git/ git@server's password: fatal: 'git-repo-name' does not appear to be a git repository fatal: The remote end hung up unexpectedly` – dsavi Jan 12 '12 at 13:58
  • Use the exact same way to clone. And don't use the `git` user, use another (remembering to configure gitolite correctly prior to the clone). I see no reason why it should not work... – fge Jan 12 '12 at 14:01
  • I had the exact same error message (the one in the question) with a cron task automatically committing and pushing a clone of a the repo of a WebApp I use. This answer helped me, I just changed the address of the repo (`git remote set-url origin git@localhost:repo_name.git` instead of previous /home/git/repositories/repo_name.git) and added the ssh key to a user with permissions. – Arnaud Mar 26 '12 at 16:21