3

I going to start new game project for multiple platforms and use GIT to control it.

I will start with PC version of the game, and then when approximately a half of game is done, start Mac, iOS and Android versions too, based on the PC version, and work in parallel.

I see two variants of the structure:

1) One project with multiple branches - one branch for one platform. And maybe shared branch with all cross platform sources...

2) Multiple projects - one project for one platform. Each project also has several branches, such a master, develop, hot-fix and others if needed. And also create separate project for cross platform sources, and then add it as a sub module to others.

First variant looks like a hell. The second one looks promising, but it has so many projects and branches... In fact I have not too many sources and game is not too big, but anyway I need so many things... It's scares.

What is the best structure for such project? Maybe there is 3rd variant?

1
  • 3
    Why wouldn't you just use a single repository for all platforms until there is a need for something more complex? That way all platforms will get the benefit of bug fixes in common code.
    – mpontillo
    Commented May 16, 2013 at 16:16

1 Answer 1

2

Maybe consider using git submodules. http://git-scm.com/book/en/Git-Tools-Submodules

With a submodule, you basically have a shared git repo inside your other git repos. This makes it easier to share common code and keep them all up to date.

I would recommend creating one repo that has all the shared code in it, then include that as a submodule in you PC, Mac, iOS, and Android repos. That will keep PC/Mac/iOS/Android specific code separate from anything shared.

3
  • Thanks, and one more question - need I to store game resources (images, sounds, ini files) in GIT too? Or GIT is only for source code? Currently I work on some project and we have everything in GIT, and I must say it is not so handy. What you think? Commented May 16, 2013 at 15:12
  • Take a look at git-annex and git-media.
    – mpontillo
    Commented May 16, 2013 at 16:20
  • Yes, I wouldn't include a large number of media files (like videos) in the repo. You'd have those off on a CDN somewhere. If it's minimal (like a basic website) than sure no problem. Commented May 16, 2013 at 18:20

Not the answer you're looking for? Browse other questions tagged or ask your own question.