Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gitolite has started giving me errors when I push to a Git repo with errors about "declined hooks"

Tags:

git

gitolite

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.

like image 366
dsavi Avatar asked Dec 15 '25 16:12

dsavi


1 Answers

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.

like image 112
fge Avatar answered Dec 17 '25 09:12

fge



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!