tags:

views:

406

answers:

1

I'm following this tutorial

After this step:

$ git commit -a -m "Allow jdoe write access to free_monkey"
$ git push

I always failed, with this error:

fatal: exec hooks/post-update failed.

This is from my /home/git/repositories/gitosis-admin/hooks/post-update:

-rwxr-xr-x 1 git git   83 Mar 10 11:49 post-update

So I change gitosis.conf manually from server for adding new repositories, and repos can work fine.

I've googled what might cause it, I want to admin gitosis in proper way.

Please Help

Regards, REV

A: 

Your post-update hook can be executed, but it cannot update the pointers in refs/heads/ and refs/remotes/ (which help when cloning with a "dumb" protocol, i.e. over http)

Check the rights associated with your repo on gitosis, especially under .git/refs

Check also if <git>/bin/git-update-server-info is executable
(you can try -- as a test -- to replace your update-hook by a link to git-update-server-info, like this case).
Or, as described here, check if you need to replace in your gitosis/templates/admin/hooks/post-update:

git-update-server-info

with

git update-server-info
VonC
Thats strange i changed my git-update-server-info to git update-server-info, but im using ssh for my remote. Error message still appear everytime git push for gitosis-admin.But i checked by deleting my gitosis-admin local repo and reclon from master my changes is written to gitosis.conf and even public key i've added is exist, does this mean git push process is succeed though post-update hook is failed to execute?
v14nt0
The post-update hook happens *after* the basic push has succeeded (hence "post-update" :-) ). What's *not* happening is the magic that gitosis does to add users/repositories etc. to .ssh/authorized_keys, etc., which is what the post-update hook does.
ebneter
So it still not solved yet, cause i prefer to admin git via gitosis in proper way. what else should check in order to make error disappear ?
v14nt0
I try to execute hooks/post-update manually using git user, error message is missing GIT_DIR value, so i set and export manually and execute post-update again no error message, but when i tried git push from client error message still appeared.
v14nt0
@v14nt0: How did you set `GIT_DIR`? did you export it? Or just set it? In the latter case, the variable was set only for your current shell, and not necessarily for the shell triggered by the post-update hook.
VonC
I only set GIT_DIR using set command and export it, i thought if i set it at .bashprofle all git command will point to that directory.
v14nt0