Gitlab post-receive/update hook to forward a commi

2019-04-02 01:58发布

问题:

In a team we have a gitlab set up that is avialable only to our team and is meant for development purposes, pushing, branching etc and we have an official git repo to which we would like to mirror commits only from master branch (stable).

I know that this can be done with use of server-side git hooks but how specifically can I do that so that the developers won't have to type anything extra and the hook will be set on gitlab (no on developers' machines - local repos) ?

回答1:

Take a look at this recipe. In the recipe the author propagates changes being pushed to the master to a working tree, you need to replace that part of the code with another git push to your public server.