Public and private branches in one Repo (BB-10774)

Issue #9692 wontfix
created an issue

Hi :D

Being able to specify certain branches as public in a private repository would be a feature that many users (including me) would appreciate very much. So far to achieve a similar effect a second, opublic repository would have to be created, making branch interactions like merge and rebase almost impossible or very complicated.

Regards TBot

Comments (12)

  1. Annamária Szentpéteri


    Me and my co-workers would like to see that feature too, because we need to represent only the branch which contains the finished codes, but we want the others to be hidden.

    We would appreciate very much if you could do this new feature.

    Regards, Annamária

  2. Just Arena

    Same here. I have several branches:

    Example: master - fresh code without hidden info -> anyone can view commits and have access to it AAAAbranch - we have some custom code here, which we wont to share between devs. * BBBBbranch - some changes from master & AAAbranch merged to this branch, and time to time we need to do merge changes from previous (hidden branches) -> and make these changes in this branch, where all people to which we give access can view history of master & BBBBbranch, but will not have any access to AAAAAbranch.

    Is it possible to do something like that?

  3. Gálffy Tamás

    We faced this issue also a few years back. Since then I did not need the feature that often, but I have come up with a workaround.

    Create one public and one private repository. The private repository will have all the branches, the public one only the, well, public ones.

    You can manage this by: 1. Having prefixes on your branch names. Something like public/master and private/secret-feature. 1. Add both of your repos as remotes. Name them accordingly, for example public and private. 1. When you want to publish public changes, just push to public, otherwise push to private.

    Of course you can spice this up with git hooks to reject pushing private branches to public, set the right upstream branch ( i.e. push public/master branch to master on public remote ) and so on, but this is the basic idea.

    Hope this helps!

    ( P.S.: Why won't lists work though )

  4. Log in to comment