Can Git hook scripts be managed along with the repository?

前端 未结 11 1169
独厮守ぢ
独厮守ぢ 2020-11-22 14:00

We\'d like to make a few basic hook scripts that we can all share -- for things like pre-formatting commit messages. Git has hook scripts for that that are normally stored

11条回答
  •  Happy的楠姐
    2020-11-22 14:40

    We are using Visual Studio solutions (and thus projects) which have pre and post build events. I'm adding an additional project named 'GitHookDeployer'. The project self modifies a file in the post build event. That file is set to copy to the build directory. Thus the project is build every time and is never skipped. In the build event, it also makes sure that all git hooks are in place.

    Note that this is not a general solution, as some projects, of course, have nothing to build.

提交回复
热议问题