title: Merge multiple git repositories into one, keeping branches history
body: <p>I have four separate projects. They have their own git repository. and the same name of branches for all projects.</p>
  
  <pre><code> /project/
   /project/projA/
   /project/projA/.git/
   /project/projB/
   /project/projB/.git/
   /project/projC/
   /project/projC/.git/
   /project/projD/
   /project/projD/.git/
  </code></pre>
  
  <p>All git repositories have the same name of branches, and of course their own master branch.</p>
  
  <h1>Question</h1>
  
  <p>I would like to merge all projects into one like so:</p>
  
  <pre><code>  /Project/.git/
    /project/projA/
    /project/projB/
    /project/projC/
    /project/projD/
  </code></pre>
  
  <h2>But</h2>
  
  <p>i want to keep the history of all branches. </p>
  
  <p>ps -> i have the same name of branches for all repo.
  for exemple: a branche name used for all four project: V6-004</p>
  
  <h2>Details</h2>
  
  <p>I tried <strong><em>submodule</em></strong> and <strong><em>subtree</em></strong> but the both doesn't solve the issue.</p>
  
  <p>I tried also this.</p>
  
  <pre><code>  $ mkdir new_parent_project
    $ cd new_parent_project
    $ git init
    # Now we need to create the initial commit. This is essential.
    $ touch README.md
    $ git add README.md
    $ git commit -am "initial commit"
  </code></pre>
  
  <p>after</p>
  
  <pre><code>  # merge project ProjA into subdirectory ProjA
    $ git remote add -f ProjA http://GitUrl
    $ git merge -s ours --no-commit ProjA/V6-006
    $ git read-tree --prefix=ProjA/ -u ProjA/V6-006
    $ git commit -m "merging ProjA into subdir: ProjA"
  </code></pre>
  
  <p>after</p>
  
  <pre><code>  # merge project ProjB into subdirectory ProjB 
    $ git remote add -f ProjB http://GitUrl
    $ git merge -s ours --no-commit ProjB/V6-006
    $ git read-tree --prefix=ProjB/ -u ProjB/V6-006
    $ git commit -m "merging ProjB into subdir: ProjB"
  </code></pre>
  
  <h2>but</h2>
  
  <p>the projects are merged but i have only the history of V6-006. but i don't have history for the others branches.</p>