This is because the avatar and username displayed in the commit are determined based on your local Git configuration, not your Github account. When the email in your Github account is exactly the same as your local Git configuration, Github will replace the email in the commit with your username and avatar.
And since Git repo is a historical tracking, the author displayed here (actually just an email string) cannot be updated. Unless you use reflog to modify the history, or delete all the history and start over.
If you want to add an avatar on Github for a previous Git commit, you can go to Gravatar to set an avatar corresponding to the email address.
This is because the avatar and username displayed in the commit are determined based on your local Git configuration, not your Github account. When the email in your Github account is exactly the same as your local Git configuration, Github will replace the email in the commit with your username and avatar.
And since Git repo is a historical tracking, the author displayed here (actually just an email string) cannot be updated. Unless you use reflog to modify the history, or delete all the history and start over.
If you want to add an avatar on Github for a previous Git commit, you can go to Gravatar to set an avatar corresponding to the email address.