創建commit-msg模板
$ vi ~/.gitcommit
編輯提交模板
xxxxxxxxx
xxxxxxxxx
xxxxxxxxxxxxxxx
xxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxx
使模板全局生效:
$ git config --global commit.template ~/.gitcommit
查詢 commit-template配置信息:
$ git config --global --list
使用commit-msg模板
請在git commit時不要用-m參數,該參數提交的日誌只有一行,無法實現上面的要求. 請用 -s 或 -v .
$git commit -s