Git-only branches

Using SVN Mirror in a self-hosted BB instance, want to isolate some of the bitbucket-only branching etc from the pure svn repos, for instance short-lived PR branches. We might want those on the BB server for review/ci testing etc, but as far as SVN is concerned they can just be the final commits in the PR merge.

Is this possible?

Hello Oliver,

yes, this is possible, SVN Mirror add-on only mirrors to SVN those branches that are included in the mapping configuration so those that are not in the mapping can be considered as Git-only branches. This can be done by adjusting the mapping, like add only some of the branches name patters in the mapping, so that branches of an another name pattern are not mirrored and thus effectively are Git-only branches, for example:

trunk = trunk:refs/heads/master
branches = branches/mirror_*:refs/heads/mirror_*

With this mapping only branches with mirror_ prefix will be mirrored while the rest branches will exist only in Bitbucket.
There is also another approach we usually recommend: separate Git-only and SVN-mirrored branches in separate Git namespaces, like:

trunk = trunk:refs/heads/master
branches = branches/*:refs/heads/svn/*

with this mapping all the mirrored branches will be placed in the svn namespace in Git, so the regular branches that reside in refs/heads by default will go unmirrored. Or the Git-only branches can be placed in another namespace, say refs/heads/feature, in this case mirrored branches can live in the default namespace:

branches = branches/*:refs/heads/*

though this probably may not that convenient for developers that use Bitbucket.

Hope this will help.

1 Like