Github にて REMOTE HOST IDENTIFICATION HAS CHANGED! が出た時の対応

github のリポジトリに push した時に下記エラーが出た。

$ git push origin someBranch

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
SHA256:xxxxxxxxxxxxxxxxxxxxxxx.
Please contact your system administrator.
Add correct host key in /Users/username/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/username/.ssh/known_hosts:2
Host key for github.com has changed and you have requested strict checking.
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

対応

/Users/username/.ssh/known_hosts:2

/Users/username/.ssh/known_hosts の2行目(自分の環境では該当ファイルの2行目に github の情報が記述されていた。)を削除したら解決した。

$ cd
$ sudo vi .ssh/known_hosts
# 2行目を削除して保存

確認

「Are you sure you want to continue connecting (yes/no/[fingerprint])?」
に対して、 yes を入力してエンター

$ git push origin someBranch

The authenticity of host 'github.com (xx.xx.xx.xxx)' can't be established.
ED25519 key fingerprint is SHA256:xxxxxxxxxxxxxxxxxxxx.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'github.com' (ED25519) to the list of known hosts.