--- lang: ja-jp breaks: true --- # git 少し前のコミットコメントを修正する方法 2024-09-11 コメントを編集したいコミットまでリベースする。 ```git= git rebase -i HEAD~3 ``` :::info `HEAD~3` 直近から3つ目のコミット ::: テキストエディタで、コメントを編集したいコミットを `pick` から `edit` に変更して保存する。 ```git= >git rebase -i HEAD~3 Stopped at b30d4e15... PKeyに依存しない、where条件を作成するメソッドを追加。 You can amend the commit now, with git commit --amend Once you are satisfied with your changes, run git rebase --continue ``` ```git= git commit --amend ``` テキストエディタで、コメントを編集して保存する。 ```git= >git commit --amend [detached HEAD 22899ae5] PKeyに依存しない、where条件を作成するメソッドを追加。 #365 Date: Wed Sep 11 09:48:51 2024 +0900 1 file changed, 56 insertions(+) ``` リベースを元に戻す。 ```git= git rebase --continue ``` ```git= > git rebase --continue Successfully rebased and updated refs/heads/main_2024-09-11_0925_09. ``` ###### tags: `git` `rebase` `コメント` `コメントメッセージ`
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up