LoginSignup
2
1

More than 3 years have passed since last update.

過去のコミットのコメントを修正する

Last updated at Posted at 2019-10-13

いつも忘れるので個人メモ。操作はVimやターミナルなどお好みで。

過去のコミットのコメントを修正する

1. 変更対象のコミットを選択する

コミットIDを指定してrebaseを実行する。
※変更対象が直前のコミットの場合、このステップはスキップしてOK。

$ git rebase -i <コミットID>

コミットの一覧が表示される。
コメントを修正したいコミットIDの行のpickの文字をeditに変更し、保存・終了。

pick aaaa1234 hogehoge comment
↓
edit aaaa1234 hogehoge comment

2. コメントを修正する

$ git commit --amend

コメントの編集画面が表示される。
コメントを修正し、保存・終了。

hogehoge comment
↓
hogehoge comment new

3. rebaseのeditを完了する(変更のFIX)

$ git rebase --continue

(参考)rebaseを中断する

$ git rebase --abort
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