0

I have been contributing to an open source project. At first, all my commits were under name yathartha. But after a while, I changed the name to Yathartha Joshi and now my new commits are under this name. So is it possible to combine the number of commits? If so how, otherwise what can I do to combine them.

I have 8 commits under yathartha and 14 commits under Yathartha Joshi.

Yathartha Joshi
  • 716
  • 1
  • 14
  • 29
  • Have a look here: https://stackoverflow.com/questions/3042437/change-commit-author-at-one-specific-commit – Opal Nov 16 '17 at 07:49
  • 2
    You need to rewrite those commits and thus rewrite the history. If you're contributing to someone elses project I'm almost certain you will just have to live with this. – Lasse V. Karlsen Nov 16 '17 at 07:50
  • GitHub Help https://help.github.com/articles/what-happens-when-i-change-my-username/ – canillas Nov 16 '17 at 07:52

1 Answers1

1

If the project has a .mailmap under the root, you can add this line to it:

Yathartha Joshi <oldmail@xxx> yathartha <newmail@xxx>

The second name and email will be replaced by the first. If the mail is not changed, the newmail part can be omitted.

Not sure if it works for the number on Github. .mailmap is used to help git shortlog summarize the output of git log. Before this line is added, git shortlog --all displays:

yathartha (8):
      commit1
      commit2
      ...
      commit8

Yathartha Joshi (14):
      commit9
      ...
      commit22

And afterwards, it displays:

Yathartha Joshi (22):
      commit1
      commit2
      ...
      commit22
ElpieKay
  • 27,194
  • 6
  • 32
  • 53