we\'re having 3 separate git repositories (each with some branches) which we\'d like to combine into one keeping full history and the ability to access the branches, like so
splice_repos is a tool I wrote that interleaves commits from different repositories into a new repository, so that same-named branches get merged histories (as though they were committed to in historical order), rather than just being merged at the end with separate histories on different branches. There's a blog entry describing the rationale behind it.
You don't want submodules as you will pull your hair out with all the git submodule update commands you will be issuing. You will also have to issue 3 git log commands instead of one to see what has happened in a certain amount of time.
Bring all of the histories into one repo. Use filter-branch to reset the directories that each repos history resides in. There is no need to stitch. You can simply merge at any point once you do the filter branch.
Essentially repoA/master, repoB/master and repoC/master will exist in the new repo you make (although you can just start with one of them). After you apply filter branch, each tree in each commit will have a new root node that will be a directory (A for repoA branches, B for repoB branches, etc).
OR
git checkout -b newbranch --root
git log --all --format=%ad%H | sort | cut -c10- | xargs -n 1 git cherry-pick
adjust the cut so it only takes the hash. Haven't tried this but let me know how it works. You may need to flatten out history first with rebase. You can't interleave the different branches and merges from the 3 different histories.
hope this helps.
Probably the easiest way to do this is to use submodules. It doesn't exactly speak to the case you're looking to achieve, but it's darn close and not very headache prone.
Just create a new directory and git init it as your "super" repo. Then add in your A,B and C repos using the commands given on the link above.