Creating a git repository in a parent folder of another git repository and removing the child repository but integrating its history into the parent
git, repository
Solution
Why not create a `bar` directory in `foo/bar`, `git mv` everything into `foo/bar/bar`, then move (without involving git) `foo/bar/.git` to `.git` and the contents of `foo/bar/bar` up to `foo/bar` finally removing the now empty `foo/bar/bar` subfolder.
Then you can add the rest of the subdirectories to the git repository which is now in `foo`.
Problem
I have the following folder structure: ``` foo/ foo/bar foo/baz foo/bee ``` I created a git repository on foo/bar/.git. I realized later on that I needed to include all the other directories in foo in a git repository, so I created a git repository on foo/.git. ``` foo/.git foo/bar/.git foo/baz foo/bee ``` I could just delete foo/bar/.git but I want to be able to keep the history of that git repository but within foo/.git instead of foo/bar/.git. I was trying to read on submodules but if I understand correctly it is a way to integrate a version of an existing repository as a subtree of your own repository. I'm not entirely sure this is what I need. I don't need to keep foo/bar/.git. I want the foo/.git to be my main repository. I just wanted to know if there was a way to keep or integrate the history of the foo/bar/.git within foo/.git so I could remove foo/bar/.git.