LoginSignup
36
18

More than 5 years have passed since last update.

コミットサブジェクト(題目)とメッセージ部分を分けるには

Posted at

本題

https://medium.com/@risacan/コミットメッセージの書き方-64aeadd92057
の[2行目に空行を設ける]の節をみて、意外と知らない人多いのかなぁ、と思ったので。

上のリンクでは、git commit打ってから、コミットログの編集画面に移行して、コミットメッセージをコミットサブジェクト(題目)とメッセージ部分に分けて書いているが、その時、2行目を空白にする必要があるという旨がかかれている。

これは、実はgit commitのmオプションを2つ重ねれば同じことができる。
つまり、git commit -m "short msg" -m "long description"を使えばよい。

どのように表示されるかは、上のリンクと参考を参照してください:

参考)
https://saraford.net/2017/01/07/how-to-commit-an-optional-extended-description-from-command-line-git-bash-007/

36
18
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
36
18