$ git config --global core.commentchar ";"
$ git config --global commit.template ~/dotfile/.gitmessage.txt
$ git config --global init.templatedir '~/dotfile/.git_template'
$ cd "your project path"
$ cp prepare-commit-msg .git/hooks/
$ git config --global core.commentchar ";"
$ git config --global commit.template ~/dotfile/.gitmessage.txt
$ git config --global init.templatedir '~/dotfile/.git_template'
$ cd "your project path"
$ cp prepare-commit-msg .git/hooks/
(#{issue}) comment | |
# どのような変更ですか? > | |
# この変更によって,どんなことが起こりますか? > | |
# なぜその変更が必要でしたか? > | |
# (fix #000) comment | |
# と書くと関連するissueをclose出来る | |
# fix は | |
# close, closes, closed | |
# fix, fixes, fixed | |
# resolve, resolves, resolved | |
# でも良い。 | |
# comment は以下参考 | |
# タイトルを50文字以内におさめる.命令形で文頭を大文字に.文末のピリオドは不要 | |
# タイトルの後は一行空けて本文を書く. | |
# 本文は以下に答えるように記述する | |
# | |
# 以下,commitの例文 | |
# 例文) | |
# - Fix A in B (Bの箇所のAを修正) | |
# - Fix for #000 (#000に対する修正) | |
# - Add A to B (AをBに追加) | |
# - Remove A from B (AをBから除去) | |
# - Remove unused A (不必要なAを除去) | |
# - Use A instead of B (AをBの代わりに用いる) | |
# - Change A to B (AをBに変更) | |
# - A in B out (AをBの変わりに導入) | |
# - Address an issue with A (Aの問題を解決) | |
# 特殊) | |
# - resurrect (蘇えらせる) | |
# - kick out (好ましくないものを取り除く) | |
# - R.I.P. (安らかに眠れ ~Removeでは語りきれない思いがあるとき~) | |
# - cosmetic change (インデントを美しくした時など) | |
# | |
# 前置詞) | |
# - with P (Pと一緒に、伴って) | |
# - for P (Pのために) | |
# - instead of P (Pの代わりに) |
#!/bin/sh | |
issue=$(git branch | grep "*" | awk '{print $2}' | sed -E 's/.*[\/|-]([1-9][0-9]*).*/\1/') | |
perl -i.bak -ne "s/{issue}/$issue/g; print" "$1" |