Combining multiple git repositories

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 git repositories. But I’d like to combine them into a single one to simplify things a little. For example, right now I might make two sets of changes and have to do something like

cd phd/code
git commit 
cd ../figures
git commit

It’d be (now) nice to just to perform

cd phd
git commit

There seems to be a couple of ways of doing this using submodules or pulling from my sub-repositories, but that’s a little more complex than I’m looking for. At the very least, I’d be happy with

cd phd
git init
git add [[everything that's already in my other repositories]]

but that doesn’t seem like a one-liner. Is there anything in git that can help me out?

14 Answers
14

Leave a Comment