Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Changes pushed to Smart mirror ends up magically in Bitbucket cloud

mepalk August 26, 2019

 

We have enabled Smart mirroring for Bitbucket cloud subscription. Although the mirror suppose to act as a a read only repo it allows pushing changes to mirror without altering the remote origin url. Somehow the push seem to be redirecting the changes to the Cloud repo. 

 

When I refer https://confluence.atlassian.com/bitbucket/work-with-bitbucket-smart-mirroring-838427532.html article in some sections it mentions that we can still push to the mirror and it will end up in primary repo and in some sections it asks to set the remote origin to Cloud repo explicitly ( git remote set-url --push origin) after we have cloned. I am confused.  Can someone explain the standard workflow a Developer need to follow when cloning from a Smart Mirror?

1 answer

1 accepted

0 votes
Answer accepted
Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 26, 2019

Hello @mepalk,

I believe you're using HTTP clone URL, can you confirm this?

The reason for the Smart Mirroring in Bitbucket Cloud documentation to mention that you won't be able to push through the Mirror using the same URL is that this will not work for SSH clone URLs (unlike Smart Mirroring in Bitbucket Server, where both HTTP and SSH clone URLs will magically work both ways).

However, HTTP clone URLs indeed do work for push with Bitbucket Cloud too because the Mirror returns an HTTP redirect to the upstream in that case, and Git client follows that redirect. I'm not sure though whether this can be overridden by some configuration property.

We decided to go with a simpler description in the documentation as we believed there would be more confusion if it was saying this only works in some cases.

So if the Mirror is used with Bitbucket Cloud, the standard workflow should generally include updating the push URL for the cloned copies.

Sorry for the confusion. Let me know if you have any questions.

Cheers,
Daniil

mepalk August 26, 2019

Hi Daniil,

Thank you for the detailed explanation. Yes we used HTTPS clone urls in this case, so that explains how the call got redirected to the Bitbucket cloud.

Regards,

Menuwan

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events