如何在服务器端git钩子中获取推送用户信息? [英] How can I get push user information in server side git hook?
问题描述
我想通过使用服务器端钩子(更新钩子)来阻止用户删除远程git分支。
我在更新挂钩中编写了shell脚本以实现该功能。
现在,我可以停止所有用户删除远程git分支,但我想给特定用户赋予删除权限,为此我们需要获取用户信息(用户名,useremail)谁正在尝试删除操作在服务器端钩子? / p>
我们有 $ USER,$ GIT_AUTHOR_NAME,$ GIT_AUTHOR_EMAIL
等变量来获取用户信息在客户端挂钩,但它们在服务器端挂钩中并不有用。
我们有其他的选择来获取服务器端钩子的用户信息吗?
这里我得到了解决方案。
https://github.com/jakubgarfield/Bonobo-Git-Server/issues/494
我们使用的是bonobo git服务器作为版本控制。
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?
Here I got the solution.
https://github.com/jakubgarfield/Bonobo-Git-Server/issues/494
We are using bonobo git server as a version control.
这篇关于如何在服务器端git钩子中获取推送用户信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!