Can Git hook scripts be managed along with the repository?

前端 未结 11 1218
独厮守ぢ
独厮守ぢ 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条回答
  •  感动是毒
    2020-11-22 14:15

    Most of the modern programming languages, or rather their build tools, support plugins to manage git hooks. That means all you need to do is configure your package.json, pom.xml, etc., and anyone in your team will have no option but to comply unless they change the build file. The plugin will add content to .git directory for you.

    Examples:

    https://github.com/rudikershaw/git-build-hook

    https://github.com/olukyrich/githook-maven-plugin

    https://www.npmjs.com/package/git-hooks

提交回复
热议问题