How do I split up an existing BitBucket repo into several repos in a project?

Viewed 222

I have a project that is SpringBoot BE and Angular FE.

Both FE and BE are part of the same repository at the moment.

I've just found 'projects' in bitbucket which appears to allow me to have several repos grouped together as a project.

What would be the best way to split my BE/FE projects into their own repos under the same project (does BitBucket have a 'create repo from this folder' sort of operation?)?

1 Answers

What I suggest you is:

  1. Create a new project and assign it a name (myapp-proj)
  2. Create a new repository inside the same project with the name that you prefer (fe-repo).
  3. Clone the new repository in a new local directory of your choice: cd mynewfolder && git clone https://myrepo .
  4. Copy the content of directory that have the owl proj in mynewfolder: cp -a /existingrepodirectory/. /mynewfolder
  5. Remove from the existing repo directory the angular directories and files
  6. Push changes to remote of first existing repository
  7. Switch to mynewfolder and remove the springBoot directories and files
  8. Push the new files and folder to new remote repo.

If the first repo is not in the project that you have create, simply add it follow this few command from bitbucket gui:

  1. Navigate to the repository you want to add to your project.
  2. Click Settings in the sidebar.
  3. Select the project from the Project menu, where you want to move the repository.
  4. Click Save repository details
Related