Can Git hook scripts be managed along with the repository?

前端 未结 11 1163
独厮守ぢ
独厮守ぢ 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:38

    You could use a managed solution for pre-commit hook management like pre-commit. Or a centralized solution for server-side git-hooks like Datree.io. It has built-in policies like:

    1. Detect and prevent merging of secrets.
    2. Enforce proper Git user configuration.
    3. Enforce Jira ticket integration - mention ticket number in pull request name / commit message.

    It won't replace all of your hooks, but it might help your developers with the most obvious ones without the configuration hell of installing the hooks on every developers computer/repo.

    Disclaimer: I am one of Datrees founders

提交回复
热议问题