How to specify a git commit message template for a repository in a file at a relative path to the repository?

后端 未结 4 1018
春和景丽
春和景丽 2020-12-08 06:23

Is there a way to specify a git commit.template that is relative to a repository?

For configuration an example is

$ git config commit.template $HOME/         


        
4条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-08 06:52

    You can always specify a template at commit-time with -t or --template=.

    See: http://git-scm.com/docs/git-commit

    Another option might be to use a prepare-commit-msg hook: https://stackoverflow.com/a/3525532/289099

提交回复
热议问题