Now I know most git experts will immediately think of git rebase
, but I am using the word "rebase" in the more general sense: I have the following structure of my project:
.
..
.git
tools
lib
src
.git
build
Both .
and ./src
directory are evidently git
repositories, and have literally a long history and large number of commits each. The repository in .
ignores src
directory (which is its own repo).
I have just realized that I would instead want to just have one single repo in .
tracking everything including the source files, because frankly, the build system is evolving along with the source code, and has become quite extensive.
My problem is that I don't know how to have this repository retain history that is now part of the repository in src
. Is it even possible? This is what I meant by 'rebasing' - if changes in ./src/main.c
are tracked by ./src/.git
across some N commits, then I want to retain these changes and have them be part of the new repository ./.git
. Same history, rebased file path.
UPDATE
Subtree merging is something else than what I want, from what I gathered on SO. In short, it does much more than what I need. I merely need the content of the old repo, together will all branches of development and all commits, tags, etc to look as if they were always part of the parent repo. In essense, the only change is paths to files themselves - where before the child repo tracked ./main.c
, the new repo will now track ./src/main.c
, and since as I have heard, git
tracks content, not files, then changing file paths like the above and references to these paths, should be rather trivial, correct?