Reputation: 1949
I am part of a private repo where I have contributed with several commits and PRs together with others. However, while others have been listed as contributors I have not and I was wondering why.
I was reading this and the problem may be related with my recent change in Github username. So while I do not want to change anything in the past, I'd like them to be recorded from now on. So I just want to make sure things are as they should.
When I ran git config user.name
I saw that it pointed to the previous one. Also, I have noticed that git config user.email
was reporting the <numbers_previous_username>@users.noreply.github.com
email (perhaps because I have kept my email private?). Would the git config --global user.email [Github login email]
be the best to set in this case?
Would running the code below in all locals fix these issues?
git config --global user.name [Github username]
git config --global user.email [Github login email]
Thanks a lot in advance.
Upvotes: 0
Views: 444
Reputation: 76459
In order for your contributions to a private repo to be reflected on GitHub, two things need to happen. First, you need to commit with an email address associated with your account (any such email address will do). You can do that by setting user.email
to an appropriate email, or adding the email address you're already using to your account. If you're already using a GitHub no-reply address, then that should be sufficient.
Second, you need to visit your profile settings page and enable the option named “Include private contributions on my profile.” That will list the contributions that are associated with private repositories in your contribution graph.
Note that you don't need to set user.name
to your GitHub username, and it's generally recommended that you don't. It should be your personal name in the form that you usually go by.
Upvotes: 1