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

后端 未结 4 1008
春和景丽
春和景丽 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 07:02

    This blog tipped me off that if the path to the template file is not absolute, then the path is considered to be relative to the repository root.

    git config commit.template /absolute/path/to/file
    
    or
    
    git config commit.template relative-path-from-repository-root
    

提交回复
热议问题