I used to store small projects in private using Bitbucket. Recently I come to check whether repositories can be grouped in a container like thing, finally I found that currently the only way is to create a “project” in Bitbucket and put repo under that project, below are the steps:
1. Create a team. A project can only be created by a team. In top navigation bar, click “Teams” -> “Create team“. Note that the creator is automatically added to the team granting the role “Administrator”. (ps: considering the ownership there’re two kinds of repo: individual repo and team repo and we will see them in step 3)
2. Create a project. In top navigation bar, click “Projects” -> “Create project“. As we can see, only team can be owners here.
Note: I will discussing three cases in the third step.
3a. Create new repo in the project. On the left sidebar under the project page, click “…” -> “Create repository“. Then a new project repo(team repo) can be created. For example the id of the team we create is “devteam“, the project id is “demo“, and the repo id is “imserver“, then the git url of the repo will be firstname.lastname@example.org:devteam/imserver.git.
3b. Add existing individual repo to the project. On the left sidebar under the project page, click “…” -> “Add repositories“, and then in the next page click “Add repositories from an individual account” at the top right. The url of the original repo may change during the process so we may need to update local git config afterwards. For example we add the repo “imclient” of the current user “bob” to the project “imclient” of team “devteam”, then the git url of the repo will be changed from email@example.com:bob/imclient.git to firstname.lastname@example.org:devteam/imclient.git.
3c. Add existing team repo to the project. On the left sidebar under the project page, click “…” -> “Add repositories“, then choose repo from the list below. There will be no url change in this case as the owner didn’t change, we only move repo from one project to another.(It seems that a team project can only belongs to one project at any moment)
Note: There’re no copy operation of repo in step 3b and 3c.