Home CommitとPull Requestのテンプレートを設定する
Post
Cancel

CommitとPull Requestのテンプレートを設定する

概要

  • CommitメッセージとPull requestのメッセージをテンプレート化する
  • 複数人で開発する際に、フォーマットに沿ったメッセージであれば、レビュー等のコードの共有の効率が向上する

参考

Commitテンプレートの設定

- .git/.commit_templateに次の内容を記載する

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Overview (Uncomment one of the following templates)
#✨ feat:
#  └  A new feature
#🐞 fix:
#  └  A bug fix
#📚 doc:
#  └  Documentation only changes
#🗑️   wastebasket:
#  └  remove ununeeded feature
#🚧  construction:
#  └  WIP(Work In Progress)
#💄 style:
#  └  Changes that do not affect the meaning of the code
#    (white-space, formatting, missing semi-colons, etc)
#🔨 refactor:
#  └  A code change that neither fixes a bug nor adds a featur
#🚀 perf:
#  └  A code change that improves performance
#🚨 test:
#  └  Adding missing or correcting existing tests
#👷 chore:
#  └  Changes to the build process or auxiliary tools and libraries
  • /.gitconfigにテンプレートを設定する
1
2
[commit]
    template = ~/.git/.commit_template

Pull requestのテンプレートの設定

## Describe your changes

## Issue ticket number and link

## Checklist before requesting a review
- [ ] I have performed a self-review of my code
- [ ] If it is a core feature, I have added thorough tests.
- [ ] Do we need to implement analytics?
- [ ] Will this be part of a product update? If yes, please write one phrase about this update.

This post is licensed under CC BY 4.0 by the author.