How to switch from a subrepo development to a new repo keeping all the history?

38 Views Asked by At

Here is a realistic scenario with a bit simplified main actors:

  • There is a repo: device here

  • There is a repo: ourdevice here

device is something developed by a third person.

ourdevice is my repo, which I created to work on further development of the device. I wanted to be able to do my own changes, but also be able to occasionally merge in the changes introduced by that third person. So I chose to go with subtree back then. This article was used as a reference heavily.

Now, I've come to a point where I am quite happy with my development of ourdevice and I'd like to embed ourdevice in a system developed for embedding the device. Unfortunately, there is that additional level of hierarchy: device is a subtree of the ourdevice, thus the folder structure in ourdevice is: ourdevice/device/-all-the-rest-.

I'd like to translate ourdevice into a new repo, be it BitBucket or GitHub by achieving both:

  1. removing that additional level of hierarchy, and
  2. keeping all the development history (commits, branches, everything) while working on device within ourdevice.

Is there any way to do this? Thank you.

0

There are 0 best solutions below