There were two independent repositories with their own stories: A and B. At some point, it was decided to place the entire contents of B in A. This was done by simply copying files, i.e. in A , a single commit for this action appeared. Further, the repository A developed, in particular, the parts that used to be in B changed.
Now there is an awareness that it was not worth merging the whole thing into one repository and needs to be developed separately.
My first thought: just transfer all the parts (files) that should be in B from A. Thus, a single commit will appear again and you can live on. But I would still like to transfer the change history of these files to the repository B.
In this regard, the question: is there any mechanism that allows you to transfer commits between unrelated repositories? The option of manually copying each individual state with the corresponding description is not suggested :) I would like, conditionally, to set the range of commits from A and apply them to B.