Home > database >  Why is a Different/Anonymous Github Account Pushing to My Repositories?
Why is a Different/Anonymous Github Account Pushing to My Repositories?

Time:10-02

Someone else's Github account shows up in my commit history when I push to my github repositories from my terminal. The commited changes are mine but the account is not.

This issue does not show up on gitlab, only in github.

The account shown in the screenshot is not mine and I do not know the account owner.

How can reset jackmwas account back to my name?

Note: I have checked both git config --get user.name and git config --get user.email which are correct and do not equal to jackmwa.

jackmwa is an existing and different github user than my own.

enter image description here

CodePudding user response:

From https://docs.github.com/en/get-started/getting-started-with-git/setting-your-username-in-git

You can change the name that is associated with your Git commits using the git config command. The new name you set will be visible in any future commits you push to GitHub from the command line. If you'd like to keep your real name private, you can use any text as your Git username.

Another interesting and helpful article could be https://docs.github.com/en/pull-requests/committing-changes-to-your-project/troubleshooting-commits/why-are-my-commits-linked-to-the-wrong-user:

Why are my commits linked to the wrong user?

GitHub uses the email address in the commit header to link the commit to a GitHub user. If your commits are being linked to another user, or not linked to a user at all, you may need to change your local Git configuration settings, add an email address to your account email settings, or do both.

If you are using GitHub Desktop, check https://docs.github.com/en/desktop/installing-and-configuring-github-desktop/configuring-and-customizing-github-desktop/configuring-git-for-github-desktop.

CodePudding user response:

  1. open your Git CMD
  2. type git config --global user.name
  3. it should give you your current username
  4. to change it, just type git config --global user.name "<new_name_here>"
  5. this will change your username when you commit to any other repo in the future
  • Related