'Move from multi repository rust project into workspace

I worked on a rust project with multiple repositories but I learned about rust workspace and I want to switch to it. Is there a way to move my other crates into a submodule while saving the git tree of each of the repositories? For example, I have repo a, b, with branches c, d, respectively, and I want to have a workspace with both projects and both branches for each of the projects.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source