LoginSignup
1
0

git commitのメッセージを複数行いれる方法

Posted at

Gitのコミットメッセージを複数行にする方法はいくつかある

  • 複数の -m オプションを使用する方法
git commit -m "First line of the commit message" -m "Second line of the commit message"
  • テキストエディタを開いて複数行のメッセージを入力する方法
git commit

このコマンドを実行すると、既定のテキストエディタが開く
エディタで複数行のメッセージを入力、保存して終了

  • コミットメッセージを直接ファイルに書き込む方法
git commit -F filename.txt

filename.txt には、複数行のメッセージを含むテキストファイルのパスを指定

複数行のメッセージを入力する際は、各行の先頭には適切なプレフィックスを追加するのがよい
EX)
fix, feat, docs

1
0
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
1
0