Jira issue number in git commit message

前端 未结 6 1147
生来不讨喜
生来不讨喜 2020-12-28 13:54

At our company we are moving from svn to git. For issue tracking we use JIRA from Atlassian.

Now we want to enforce that every commit message contains an issue numbe

6条回答
  •  鱼传尺愫
    2020-12-28 14:34

    If you are using npm you can use https://github.com/typicode/husky with https://github.com/marionebl/commitlint

    Create file: commitlint.config.js

    module.exports = {
    rules: {
        'references-empty': [2, 'never']
    },
    parserPreset: {
        parserOpts: {
            issuePrefixes: ['REF-']
        }
    }};
    

    and add config for the hook in package.json

    commit-msg: commitlint -E HUSKY_GIT_PARAMS
    

提交回复
热议问题