2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Git commit templateを使用する

Posted at

GitのCommitメッセージテンプレートを使用して、commit historyの質を向上させる。

  • プロジェクトごとの設定
  • Global設定
  • テンプレートのサンプル

.gitmessage Example

vim .gitmessage
# Title: Summary
# No more than 50 chars. #### 50 chars is here: #

# Empty line between title and body.

# Body: Include *what* and *why*. Including ticket ID is encouraged.


アプリケーションのProject Rootに配置して、プロジェクト毎にテンプレートを使い分ける場合

touch .gitmessage
git config commit.template .gitmessage

UserHomeに配置して、プロジェクトにかかわらず同一のテンプレートを使う場合

touch ~/.gitmessage
git config --global commit.template ~/.gitmessage

使い方

git commit # Tempalteが反映される
git commit -m "Ignore template message" # Tempalteを無視してCommitを行いたい場合
2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?