Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

My commits appear as another user in GitHub?

I am trying to set up git on my laptop so I can push commits to GitHub. This now works, but if I do so and then visit GitHub, it appears as if some random user (always cbeaudoin898 - I have no idea who this is) made all the commits. It is super weird, I have no idea what is causing this. When I push the commit, I log in with my own username & password. I also have this set in my git config. Here is an example repo: https://github.com/kmb5/etch-a-sketch

My git config: git config Screenshot of how a commit appears on GitHub: github screenshot

Here is the commit log: commit log

Does anyone have any idea why this is happening? I am getting crazy, setting up GitHub was a pain as is, because I tried to set it up for 2 different GitHub accounts (work and private) - which was a hassle on its own.

like image 923
bende Avatar asked Oct 31 '25 18:10

bende


1 Answers

For anyone facing this issue please first check if you have a typo or wrong or a different email address configured in your local git (step 1 below). If so, then this might solve the issue as it did for my repo once upon a time.

1. To View the Current Name and Email:

git config --global user.name

git config --global user.email

2. To Update Correctly:

git config --global user.name "Your Correct Name Here"

git config --global user.email "Your Correct Email Here"

3. Also repeat 1. and 2. without the --global option.

4. Now You Must Reset the Author

git commit --amend --reset-author

5. Finally can do Forced Push

git push -f

6. Verify on GitHub

7. Vote this answer if it worked.

like image 141
user3330840 Avatar answered Nov 03 '25 09:11

user3330840