Home > Back-end >  Mirror profile activity along with the mirrored repository from GitLab to GitHub
Mirror profile activity along with the mirrored repository from GitLab to GitHub

Time:01-31

I have the following scenario:

  • I have a repository in GitLab which I set to mirror into GitHub under the same name;
  • I am the owner of both repos (original one and the mirror);
  • when I commit to GitLab, all the changes are automatically pushed into GitHub mirror via personal access token;
  • my profile activity is updated on GitLab, however, on GitHub there are no changes.

One of the suspected reasons is that both of my GitLab and GitHub accounts use private emails, which means that GitHub cannot recognize that the author of commits is actually me and does not update my profile activity.

The other possible reason I thought about was the permissions of personal access token. Apart from "repo" permissions I also granted "user" permissions, to get r/o access on email data. But that didn't seem to work, after making a test commit.

I am currently trying to sync both of my GitLab and GitHub accounts to a single email adress. I do not like this option, because I feel comfortable using private adresses. And I also feel like I'm potentially going into the wrong direction here.

So if you have any ideas on how to do this -- I would appreciate if you shared your knowledge!

CodePudding user response:

Ok, I found the solution myself.

Basically, as I suspected (but did not check first), both GitLab and GitHub accounts must be linked to the same public email address.

In addition, I just found out that GitHub has an interesting policy on registering contributions: https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-github-profile/managing-contribution-settings-on-your-profile/why-are-my-contributions-not-showing-up-on-my-profile#commits

In my case, I commited to the non-deafult branch, so the contributions I made showed on GitLab, but not on GitHub.

Anyway, I hope this will help someone in the future.

  • Related