How to fix the error cause the gitHub repository to display the commit name differently as the name of the account?.

Renatus Bashishwa 0 Reputation points
2024-09-12T14:04:31.74+00:00

1000129950

What cause the differences as shown in the image and how to fix it?

Azure Digital Twins
Azure Digital Twins
An Azure platform that is used to create digital representations of real-world things, places, business processes, and people.
232 questions
Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
3,046 questions
Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,556 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. JimmyYang-MSFT 55,061 Reputation points Microsoft Vendor
    2024-09-13T07:55:58.7233333+00:00

    @Renatus Bashishwa

    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

    1. To Update Correctly:

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

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

    1. Also repeat 1. and 2. without the --global option.
    2. Now You Must Reset the Author

    git commit --amend --reset-author

    1. Finally can do Forced Push

    git push -f

    1. Verify on GitHub

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


    1 person found this answer helpful.
    0 comments No comments

  2. Q&A Assist
    2024-09-12T14:04:31.7466667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The reason why a GitHub repository may display commit names differently than the account name is that Git stores the name and email address of the author in its configuration file, which can be different from the name and email used to sign in to GitHub. This can happen if the author has used different names and email addresses across different commits, or if the author has changed their Git settings over time. To fix this, you can update your Git settings to ensure that the correct name and email address are included in your commits. You can do this using the git config command, either globally for all repositories on your system or locally for a specific repository. You can also update your profile in GitHub to ensure that your name and email address are correct.


    References:

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.