Unity, Git and Multiple Branches as different launchable games

Hi there,

I need your valuable suggestions and guidance if you have solved similar situations.

I use Git for very simple commit and push but have never used in branches, so i dont know what i should do to achieve following goal but ill try explain in my little knowledge as much as possible :slight_smile:

Here is my “ideal” usecase.

1-I buy a quiz template, and create a repository and put it in master branch.

2- Now i create a Custom Branch based on master and name it “Skinned&Improved”. I then skin it and make code improvments in it.

Now i make 3 branches based on “Skinned&Improved” and name them “English”, “Chinese” and “Hindi” and all these 3 branches will be usued as 3 games for 3 different audiences.

So far so good.

Now, original author update the template, and in that case i update the master branch, and “expect” 2-“Skinned&Improved” to get all the changes from master branch BUT still override all those changes that i did. For example, if original author add a new button, my “Skinned&Improved” gets this new button but all the old buttons show my overriden textures.

Similarly, when i make changes in “Skinned&Improved”, i want all the 3 sub branches “English”, “Chinese” and “Hindi” to have those changes BUT still override any change those sub branches made.

Just like a Super > Subclasses WAy.

Now i hope what i want is should be clear, and i might be using wrong terminologies or i shouldnt be using branches but forks or smething else and this is where i need your valuable help :slight_smile:

Thanks

This isn’t really what branching is intended for…

The idea of branching is allow work on a feature/bug/enhancement/etc separated from the master, only pushing once you’re done. This way you can still commit interrum changes of a branch without it being pushed up to the master.

A common setup is called gitflow where you have the following kinds of branches:
master - a single branch, it represents the current master, this will usually only be pushed to during a release

release - a new branch for each version of a release, so you can go back to previous versions

hotfix - created anytime you need to do a quick hotfix of a release, this is for small bug fixes that need to be added right away, and can’t wait for the scheduled next release

dev - the main dev branch, this acts as the psuedo-master between releases

feature - a single feature/fix that is scheduled during dev time. All features are what add up to a release.

…

Sub-branching technically isn’t a thing. What’s really going on is you’re creating a branch based off another branch… which technically means you’ve sub branched… but you don’t necessarily have to push back the branch you based this branch off of. You can push anywhere.

As well as rebase off any branch.

So technically yes, you could implement something where you branched like you describe, and then merge/rebase off of other branches, that you’ve designated in a hierarchial fashion.

Your syncing is going to be weird… and would probably be best done scripted to avoid issues.

But even then… I see huge issues in your future doing this. Maintaining such a structure can become a lot of work. Especially if it’s just to get language swapping. There’s more traditional designs out there for handling multiple languages, especially ones that are more feature rich. For instance, say you wanted to release for the European market, it’d be ridiculous to have 10,15,even 20 different builds of the program just for every smaller language market within Europe. Instead you do a complete European release, with a language switcher in the options of the game (usually the game boots right into the language selector).

Thank you for your detailed reponse , appreciate that :slight_smile:

When i say English, Chinese it didnt mean it to be translation which we can do using many multilingual assets in store but more like entirely different game with different design as well as content.

Now imagine i have 100s of those games (French, Arabic etc), sub-branching (as you said it doesnt exist but to explain my point) is what i see to maintain them.

How do you propose to solve this requirement?

Thanks :slight_smile: