修正方法
以下のコマンドを実行します。
ターミナル
$ git rebase -i --root
するとGitで設定しているエディタが開きます。
pick f2a0ijl 最初のコミット
pick 4d506gf 2回目のコミット
pick 23456a5 3回目のコミット
最初のコミットのpick
の箇所を編集します。
r f2a0ijl 最初のコミット
pick 4d506gf 2回目のコミット
pick 23456a5 3回目のコミット
すると以下のようにエディタに表示されます。
最初のコミット
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
コミットメッセージを変更して保存し、エディタを閉じます。
initial commit
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
コミットメッセージが変更されたことを確認してpush
します。
$ git push -f origin main