Git – How to Split a Git Repository into Two

git

Nearly a year ago, I started writing a game. I was just messing around at the time, but now I'm pretty serious about it. As it's grown, it's taken on the responsibilities of a major game engine, as well as the game logic of an actual game.

At some point, I decided I should break the two out, and designate a game and a game engine. I kept this separation in mind as I programmed for about the last 8 months, but I never did actually separate them.

Now I intend to finally move forward with this. The project is all in one git repository right now. I'd like to have two repositories; one for the game engine and one for the game.

I have two concrete questions:

1) How should I split the repository? I'd like to maintain history, so I'm thinking I'll just cp the repository, prune the two, and then check in. Any better ideas?

2) Should I add my game assets (models, images, sounds..) to the game repository, or should I make a third for these? I have quite a few assets, and many are subject to change, so it could create an inconvenient amount of noise.

Best Answer

As for #1, git provides some tools to make that very easy to do. For #2, I'd suggest a 2nd repository to keep your history clean and useful. You can pull it into your main working tree easily with git submodules.

Related Topic