2

My bitbucket has become a mess. I am trying to understand (w/o too much command line voodoo) how to organize. In other source controls i never had this issue (svn, tfs, etc)

For instance, I have a project that contains 3 completely separate repos: 1.) Development (source code c#, f#, etc) 2.) Database (scripts, etc are source controlled to different repo) 3.) Aux stuff for Netopsie type things

Most of my projects follow this pattern, what I would like to see in bitbucket is:

ProjectName
   ->  Development (repo)
   ->  Database (repo)
   ->  NetOps (repo)

Is this easily accomplished using bitbucket / git ?

schmoopy
  • 6,419
  • 11
  • 54
  • 89

2 Answers2

1

Sure: you can use submodules in order for your new ProjectName repo to reference the exact SHA1 of each of your existing repos.

That will ensure that when you git clone --recursive https://bitbucket.org/<user>/ProjectName, you will get the three repos at the version needed for them to work together (instead of just the latest version of their respective master branch, which might or might not be compatible with the other repos).
If you need for those submodules to be always updated to the latest version of a branch, you can specify it too.

In any case, create an empty BitBucket repo, clone it, then

cd /path/to/ProjectName
git submodule add -- https://bitbucket.org/<user>/Development
git submodule add -- https://bitbucket.org/<user>/Database
git submodule add -- https://bitbucket.org/<user>/NetOps
git add .
git commit -m "add 3 repos"
git push -u origin master

See also:

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • i tried this and cloned successfully the new empty repo, but when i try the submodule add I get this error: Cloning into 'Development'... remote: Not Found fatal: repository 'https://bitbucket.org//Development/' not found Clone of 'https://bitbucket.org//Development' into submodule path 'Development' failed – schmoopy Dec 29 '15 at 00:00
  • @schmoopy the idea of this answer is to illustrate how to group *existing* repos into one parent repo. So it would only work if you have an *existing* Development repo on Bitbucket. Do you? – VonC Dec 29 '15 at 05:47
  • i see, so when i go to bitbucket i still have a flat structure? This is what I am trying to avoid - as the original question says, my bitbucket has become a mess because of the lack of a 'folder' type structure. – schmoopy Dec 30 '15 at 00:36
  • @schmoopy yes, flat list of repos, but with the possibility of grouping some repos in a parent repo. – VonC Dec 30 '15 at 08:00
0

Oddly and unfortunately this feature does not exist within bitbucket, however please go here to vote for this feature to be added:

https://bitbucket.org/site/master/issues/12182/repository-projects-folders-and-labels

You can see all of the users who have requested this here: https://bitbucket.org/site/master/issues/2323/create-a-way-to-group-repositories

schmoopy
  • 6,419
  • 11
  • 54
  • 89