'Git force-push with wrong account

I added a few commits to a branch that I just created locally, squashed them and force-pushed to remote. But when I check on github web UI, it says that I "added the commit" and another person "force-pushed". But the only git account I have ever configured in my terminal is my own git account.
If I do git log locally, the commits have correct username and email (me). It seems that it's only pushing with another person's account, but I don't understand why. Is it because I used to git reset --hard to this person's commit on another branch and this reset somehow changed some configuration of my git? How can I fix this and make github UI show the right person who pushed the commits?



Solution 1:[1]

. It seems that it's only pushing with another person's account, but I don't understand why

That would not have anything to do with commit authorship.

It would involve your authentication when pushing: in case of HTTPS URL, check if your credential manager does have the wrong account cached.

printf "host=github.com\nprotocol=https"|git credential-$(git config credential.helper) get

Solution 2:[2]

Ran ssh -vT [email protected]. Turns out I was logged in as someone else with a wrong id_rsa file.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 VonC
Solution 2 instant501