How to customize the clone URL for a Bitbucket Server Smart Mirror

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

Once you have set up a smart mirror, you'll notice that Bitbucket Server provides a git clone url for you by default which may look something like:

1 git clone ssh://git@someMirrorHostname.net:7999/bitbucket1/someProject/someRepo.git

You may, however, want something other than what Bitbucket Server has generated in the the upstreamidentifierpart of the clone URL.

Solution

Resolution

  1. Install Mirror

  2. Before starting mirror add the following to the $BITBUCKET_HOME/shared/bitbucket.properties file:

1 plugin.mirroring.upstream.namespace=<custom-upstream-identifier>

The <custom-upstream-identifier> bit will replace the Bitbucket Server generated upstream identifierportion of the clone URL.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.