16

A project I used to work on has recently moved from using self-hosted Subversion to GitHub-hosted git for its source control solution. My name appears in the commits, but I can see no way of claiming these as being "mine" from my github account.

I know there must be some way of doing this, as other contributors have their contributions linked to a github account, even before the move was made to using github.

Can anyone tell me how I can claim these changes as being mine?

  • Maybe you need to add a .mailmap file. I'm not sure if GitHub respects them, though. – asmeurer Apr 12 '13 at 22:19
  • Ah, it looks like it doesn't. – asmeurer Apr 12 '13 at 22:22
12

GitHub user account matching for commits is done via the email address associated with the git commit on one side (i.e. your user.email setting) and those associated with the GitHub account on the other (see “About commit email addresses” and “Why are my commits linked to the wrong user?” in the GitHub User Documentation). To match your commits to your account, just add their associated email address(es) to your GitHub account.

  • 2
    Will github apply those to the contributions graph retroactively? Doesn't seem to do so. – Matt M. Jan 16 '13 at 2:55
  • 1
    @MattM. I’m not sure about that. If it doesn’t, that would seem a bug in GitHub’s handling of the graph to me. Report to them maybe? – kopischke Jan 16 '13 at 9:07
  • For the sake of completeness, those wrong email setting is likely caused by an prior email changing. Indeed, who would know such Best practices for leaving your company BEFOREHAND? Github should have let me know such consequence when I was deleting my old email via their profile setting page. – RayLuo Jan 16 at 22:14
0

In addition to kopischke's answer:

Since the matching is done by email address - if the email in the commit matches your email, it will do it automatically.

Ideally, this email replacements and fixing should've done while converting from SVN to Git. If using tools to convert it, there are also options to map each email/user to another email that will be written in the corresponding Git commits.

  • I did it for my organization when moving projects from SVN to Git, and it worked great. Though I had to map a lot of address manually since the scripts I created to automate it couldn't catch all the cases, but everything worked and each email in any commit was associated to an user in the organization.

After the project was uploaded to GitHub (or any other Git hosting service) or shared with others in any way - it's much more problematic:
It's possible to edit all the commits retroactively locally, and supply the information you want (i.e the new email), but you'll have to force push the repo and everyone will have to force pull it.
It's plausible if the project has small amount of members/contributors and no forks, and then you can reach each of them and arrange that change.

I really don't think GitHub offer a tool like that, but, maybe if you'll add the email in the commit as another email to your GitHub account - it will recognize it - worth trying if possible.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.