Let\'s say I\'ve got a setup that look something like
phd/code/
phd/figures/
phd/thesis/
For historical reasons, these all have their own g
git-stitch-repo from Aristotle Pagaltzis' answer only works for repositories with simple, linear history.
MiniQuark's answer works for all repositories, but it does not handle tags and branches.
I created a program that works the same way as MiniQuark describes, but it uses one merge commit (with N parents) and also recreates all tags and branches to point to these merge commits.
See the git-merge-repos repository for examples how to use it.