Isaac Guan
Isaac Guan

Reputation: 231

Import contribution to github from bitbucket

I just got a new job recently, and all repos of their projects are on BitBucket.
I used to use a lot GitHub, so I was wondering if there is a way to sync contribution between the two.

I have already tried https://github.com/jrm2k6/contwidgetor. It seems like a way to do it but didn't work for me somehow, and there is only limited support of it.

Upvotes: 8

Views: 6368

Answers (3)

svea
svea

Reputation: 1

I was in the same situations, so I just whipped a node script together. I think it's more simple (implementation wise) than the solution posted by mir88.

The program then makes a shadow repository on GitHub. Each Bitbucket repository is represented by a file, and each Bitbucket commit is reflected by the Bitbucket commit hash. The Bitbucket hashes are added backwards in time so the match the point in time when the original commit was made on Bitbucket.

Should be easy to change to your exact needs.

Feel free to check it out: Bitbucket 2 GitHub Activity Sync.

Upvotes: 0

mir88
mir88

Reputation: 318

You can use Contributions Importer for GitHub

It copies all commits from source git repositories to a mock git repository. Each copied commit will report the same commit date, but the original code is not copied, neither the commit message.

The mock code is generated using the same language of the original source repository.

For example, I have a mock repository on my profile that reports all the activities of all my private repositories.

Upvotes: 11

VonC
VonC

Reputation: 1324606

You can at least manually mirror any Git BitBucket repo from BitBucket to GitHub:

git clone --mirror http://user@bitbucket/user/repo.git
git remote add github http://[email protected]/user/repo.git
git push --mirror github 

(Create an empty repo on GitHub side first)

Then, on demand, you can go into your local clone, do a fetch, and then a git push --mirror github again to sync new commits.

Upvotes: 5

Related Questions