How would you recommend to manage client-specific functionality and change requests within Git-flow, or Git in general? Should client-specific features be in a separate branch dedicated to the client? (Each client having its own branch from the develop branch.) Or should they be in a separate repository? (Each client having a dedicated repository, with the master repository being our main repository.)
Gitflow can be used for projects that have a scheduled release cycle and for the DevOps best practice of continuous delivery. This workflow doesn't add any new concepts or commands beyond what's required for the Feature Branch Workflow.
Git Flow is usually more complicated than GitHub flow. It is used when your software has the concept of “release”. This flow works perfectly when you work in a team of one or more developers and they collaborate on the same feature.
The two primary branches in Git flow are main and develop. There are three types of supporting branches with different intended purposes: feature, release, and hotfix.
It sounds like you have a code base that all clients use, and then you have some "hacks" for client specific functionality.
In my opinion, you would have all of the "base" code on the master branch. All clients would have a client specific branch. Be careful and know where your changes are being made.
Every so often, make sure you rebase your client branches, basically bringing them up to the base code and then replaying all of their specific changes on top of that.
Rebasing can be quite confusing until you see it in action.
Using sequential commit numbers for clarity. Commits are not numerical in real life
Master is at commit 10 \ Branch has commits 10, 11, 12, 13, 14, 15 (notice it has commit 10 as well) | Master commits 16, 17 When you rebase: Master has 10, 16, 17. Branch has 10, 16, 17, 11, 12, 13, 14, 15
The order here is very important. Rebase rewinds the branch to 10, applies 16 and 17, and then replays its changes of 11, 12, 13, 14, and 15.
At this point, as long as there are no conflicts, the branch is up to date with master AND has the client specific changes.
I would create a separate repository for your base and clients. The clients would have a base that would have a remote branch, being your base. When a client needs a new release it's much easier this way. If you would put all clients in one repository, you would have to manually change the integration/developer branch before you do a git flow release start. This would limit your ability to work on multiple releases for different clients.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With