Menu

📰
0

Repository organization when working on multiple code "variations"

Reddit r/git·u/Ettapp·about 1 month ago
#WzNVLW9H
#code#variations#game#branch#usually#article
Reading 0:00
15s threshold

Hi everyone !

I'm used to use git in a simple and almost boring way (a production branch - usually `main`, a staging one where all the merges and tests happen before updating prod, and the one or more per dev - usually single-feature related).

Recently I've started to learn a new language and am putting it in practice by developing a mini-tiny game. I've created different "variations" of said game (different sprite resolutions, game resolution, tick duration, NPC pathing, ...). Only a small part of the code is common to all variations (think embedded assembly).

I need to keep all those variants for comparison purposes but need to have them separated.

Currently I've created one branch per variation, and cherry-pick the common code from the most advanced branche onto the others, but I wonder if there is a better way.

Thank you in advances for your advice !

Read More