gitgithooks

How can I get push user information in server side git hook?


I would like to stop users to delete remote git branch by using server side hooks(update hook).

I have written shell script in update hook to achieve that.
Now I am able to stop all users to delete remote git branch, but I want to give delete permission to specific user, to do this we need to get user information(username, useremail) of who is trying the delete operation in server side hook?

we have $USER, $GIT_AUTHOR_NAME, $GIT_AUTHOR_EMAIL etc variables to get user information in client side hooks, but they are not useful in server side hooks.

Do we have any other options to get user info in server-side hooks?


Solution

  • Here I got the solution.

    https://github.com/jakubgarfield/Bonobo-Git-Server/issues/494

    We are using bonobo git server as a version control.