0

I have a project at Bitbucket. I want to migrate it to Github. However, when I import it I do not seem as contributor.

I've set:

git config user.email "email@example.com"

I use same e-mail address both for Github and Bitbucket. However, they are not linked. How to Import Existing Project into Github with History?

Anshul Goyal
  • 73,278
  • 37
  • 149
  • 186
kamaci
  • 72,915
  • 69
  • 228
  • 366

2 Answers2

0

The change to git config user.email won't affect the old commits, only the new ones.

The repository history was most likely migrated as-is and you would have to rewrite the history if your e-mail differs between Bitbucket and Github. One example would be to use git filter-branch operation before importing to Github as shown in this answer.

It's also possible that Github haven't refreshed the Contributors page yet. As per https://help.github.com/articles/why-are-my-contributions-not-showing-up-on-my-profile/ it can take up to 24h.

Karol Dowbecki
  • 43,645
  • 9
  • 78
  • 111
  • OP says the same e-mail is used for both GitHub and Bitbucket. Perhaps the problem lies in how GitHub updates the Contributors page? – jsageryd Apr 03 '18 at 17:41
0

This might be related to a limit on Github's end that the contributions history is limited only to the last 1000 commits in case of a larger number of commits are pushed in a single push. (I discovered and mention it the PS section while tinkering some time back).

If that is what is happening in your case, i.e., by importing a repo you mean you're pushing your bitbucket code into a fresh repo in github manually using git push github master, you may want to break down your pushes into small batches. Create a tag every 1000 commits or so from the initial commit, and push these tags in chronological order.

The setting git config user.email "email@example.com" is used only when new commits are being created, so it doesn't have any affect here other than that your future commits will show in contribution history.

Also, as mentioned on github.com articles, ensure that:

Commits will appear on your contributions graph if they meet all of the following conditions:

  1. The email address used for the commits is associated with your GitHub account.
  2. The commits were made in a standalone repository, not a fork.
  3. The commits were made: a) In the repository's default branch, usually master b) In the gh-pages branch for repositories with Project Pages sites
Anshul Goyal
  • 73,278
  • 37
  • 149
  • 186