If the two apps are identical and the only difference is the database, then creating multiple environments, all pointing to the same branch, each with its own database is a good solution.
But creating one branch per client allows to have slightly different apps while maintaining only one. For example you could customize the styles or a form in one client’s branch and not in the other.
Workflow example:
- create one
devand oneclient1branch - work on the
devand when you are ready merge toclient→ at this point you have the app ready for the first client - your marketing works hard and finds a second client
- create the third branch
client2on the same commit asclient1→ now the two clients are using identical apps (and possibly different databases if that’s their environment setup) - you decide to add a feature for both:
- make
devthe editing environment - add your feature
- make
client1the editing environment - right click on
devand merge toclient1 - make
client2the editing environment - right click on
devand merge toclient2→ at this point both clients have the new feature
- make
- the second client only wants a new feature:
- create a
dev2branch whereclient2is - make
dev2the editing environment - add the new feature
- make
client2the editing environment - right click on
dev2and merge toclient2→ at this point only client 2 has the new feature - delete the
dev2branch. At this point it’s a good idea to deletedevtoo, just to decrease the chances of merge conflicts in the future
- create a
- you want to add a new feature for both:
- create a new
devbranch either onclient1orclient2, it doesn’t matter, just pick one - follow the steps above. At the end only the lines edited in the
devbranch will be merged, you are not copying, you are merging only the modified lines
- create a new
The difference between the clone approach and the multiple branches approach is that:
- when you add a feature to both original and cloned app, you need to remember all the parts you touched on one app and do the same on the other. If the apps are identical, you can just copy the files, but if you customized one of the apps, then you need to manually apply the changes to the second app one by one
- when you want to add a feature to both client branches, you edit once in the
devbranch, then you merge it to bothclient1andclient2. Git will take care of merging only the lines that you modified since the last merge and leave any previous customization as is
PS: Notice that I have not mentioned the master branch in this workflow. I think that the master branch should be removed. It’s confusing and only makes sense in most other git workflows, I don’t think it belongs in Anvil.
You could reset it to an older branch so it’s out of the way, just like this:
