16
15

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 5 years have passed since last update.

gitのコミットログの内容を修正する

Posted at

直前のコミットログを修正する

git commit --amend

これでコメントの内容を修正して、:wqで保存して終了すれば書き換えられます。

直前以外のコミットログを修正する

例) 過去3つ分のコミットログを修正

    1. 編集対象のコミットを選ぶ
git rebase -i HEAD~3

エディタが開きます。
コメント修正したいコミットの、pickってなってる部分をedit(eでもOK)に書き換えて保存。

    1. コメントを編集する
git commit --amend

これでコメントを修正して保存します。

git rebase --continue

編集するコミット分だけ、git commit --amendgit rebase --continueを繰り返す。

16
15
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
16
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?