Now I know that most git experts will immediately think about git rebase , but I use the word "rebase" in a more general sense: I have the following structure for my project:
. .. .git tools lib src .git build
Both directories . and ./src , apparently, are git repositories and have literally a long history and a large number of commits. Repository c . ignores the src directory (which is its own repo).
I just realized that instead I just want to have only one repo in . tracking everything, including source files, because, frankly, the build system is developing along with the source code and has become quite extensive.
My problem is that I do not know how to save this repository in the history, which is now part of the repository in src . Is it possible? This is what I meant by βrebasingβ - if changes in ./src/main.c tracked by ./src/.git through some N commits, then I want to save these changes and include them in a new repository ./.git . Same story, reinstalled file path.
UPDATE
Merging subtrogs is something other than what I want from what I put together on SO. In short, he does much more than I need. I just need the contents of the old repo, as well as all development branches , and all commits, tags, etc. They look as if they were always part of the parental repo. In essence, the only change is the paths to the files themselves - where ./main.c tracked to the children's repo, the new repo will now track ./src/main.c , and since, as I heard, git tracking content, not files, and then changes the file paths as described above, and the links to these paths should be pretty trivial, correct?
source share