开发者

How to track post-receive hook in gitosis

Is there are way of managing a post-receive hook via gitosis-admin so that changes to it can be tracked?

I gitosis on a remote server with a couple of repositories that I can push to. The 2 repositories are setup via gitosis-admin and each have a different post-receive hook, which was setup manually by ssh'ing to the remote server. It strikes me that these should be in git somewhere so any changes t开发者_开发技巧o them can be tracked.


You can't track the hookfiles themselves, for security reasons. But you can sneak around that:

Make a git repo with your hookfiles and check it out on the server. Then just symlink the hookfiles in the repos where you need them. You might also want to add another hook action that does a pull on the checkout of the hook repo, if you don't push directly to it.

Make sure you tightly control access to that repo, because if an attacker can push to it, you're toast.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜