How to make a GitHub mirror to Bitbucket?

You could simply add a second remote:

git remote add bitbucket /url/to/am/empty/bitbucket/repo

and push everything to bitbucket:

git push --mirror bitbucket

You can actually pull from or push to multiple remotes from your local repo.


Update 2020:

As noted below in Rahulmohan Kolakandy’s answer, if you are talking about an on-premise BitBucket server (as opposed to bitbucket.org), then you can take advantage of BitBucket Server Smart Mirroring.

As commented by V-Q-A NGUYEN:

BitBucket Server Smart Mirroring (introduced originally in 2016, and Oct. 2017 for BitBucket Server)

is only available for customers with an active Bitbucket Data Center license

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)