Pergunta

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.)

Foi útil?

Solução

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.

Outras dicas

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top