Mirror Github repo using bitbucket cloud

Travis Travelstead January 17, 2020

I am working on a project that needs to only have the latest from a remote repo, we then  make customized branches from that repo for our specific needs. We do not want to push any updates to the original repo.


I have been able to do this with Gitlab using there repo mirroring feature. I assumed SmartMirror features in Bitbucket Cloud Premium would do this, but I cannot see information on this use-case.

1 answer

0 votes
Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 17, 2020

Hello @Travis Travelstead,

Unfortunately, there's no feature of mirroring repositories hosted externally. Smart Mirroring is about mirroring repositories hosted on Bitbucket Server or Cloud, useful for remote locations with limited internet connection and/or huge repositories.

There might be third party solutions for this, but I'm not aware of any.

project that needs to only have the latest from a remote repo, we then make customized branches from that repo for our specific needs. We do not want to push any updates to the original repo.

Doesn't this mean you can clone remote repository once and then work on that copy?

Cheers,
Daniil

Travis Travelstead January 18, 2020

Thanks for the response. 

We are working on a release system, so that we branch from a commit/release of the external repo. But we also want to keep getting the latest so that we can work on with new features and the next release.

We are currently cloning and then working from that clone, but we want to stay connected in one direction to pull and never push. 


This is also helpful because it allows us to setup CI in one location, and build both old and new version in a single place with minimal new work. 

Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 20, 2020

Ok, I see what you mean, thanks.

Well, this unfortunately requires manual fetching from upstream and updating your Bitbucket copy. That said, there's no way to fork/mirror repositories outside of Bitbucket automatically.

What I can think of as a work around is configure a scheduled Pipeline that would do exactly that manual work: fetch from your external repo and then push to the Bitbucket copy. A more sophisticated solution would be to listen to webhooks from the external repository, if they are available, and fetch and push based on that.

Hope this helps. Let me know if you have any questions.

Cheers,
Daniil

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events