8

I have two branches in my bitbucket repository - master and dev. I want the master branch to read and clone for everyone. Write will still be restricted on master. However, the dev branch should be visible only to developers and it should stay private among developers. This branch is shared among developers who will commit and push for others. How do I enforce a branch to be private in a public repository on bitbucket?

2
  • The best you can do in a single repository is to restrict push to that branch. Why do you need to completely hide the dev branch? Commented Jul 26, 2016 at 16:32
  • since these are research projects, the dev branch is also used to exchange ideas and build up on it. we would like to share the code and idea to public only when it is completely ready. Having another repository for development restricts the capabilities of merge and we have to manually do it. Commented Jul 27, 2016 at 13:03

1 Answer 1

7

No, this is not possible. A branch is nothing of substance in git, it is just a "sticky note" pointing to a commit. There is no sense of "these n commits belong to branch X and should be private", so anyone who pulls stuff from your repository can get all your commits.

If you insist on having the development private, just fork the repository and make the fork private...

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.