Manage multiple git release branches for multiple customers

前端 未结 2 1157
孤独总比滥情好
孤独总比滥情好 2021-02-08 21:33

My company has a piece of software we sell to multiple customers. But every customer have some different requirements (more than just \"Put our logo here\"). The core i

相关标签:
2条回答
  • 2021-02-08 21:48

    Thanks for @AnimiVulpis. His/Her answer gave me a hint. Here's my solution: (also base on the nvie's strategy)

    1.Extract the exact common parts from project. Create a branch named shared/develop

    2.Based on the shared/develop, creating a customer1's branch

    git checkout -b local/customer1/develop origin/shared/develop
    #push this new branch to remote
    git push origin local/customer1/develop:origin/customer1/develop
    git push origin local/customer1/develop:origin/customer1/master
    

    3.Same with step 2. create other customers' branch.

    4.All the common parts used for all customers should work on shared/develop branch.

    4.All the feature development just for the customerN should work on its own customerN/develop branch.It should be note that all the customers' branches should merge from shared/develop branch before a new feature coding.

    0 讨论(0)
  • 2021-02-08 21:54

    I think a simple and viable solution might be to have develop and release branches for every customer.

    Edit: previously develop was called master in the sentence before, but I like develop better


    • All the common things would live in the shared develop branch
    • Each customer would have it's own develop and release branches

    You would have to take extra care to make changes that affect all customers in the shared develop and changes that only affect specific customers only on their respective branches.


    Scenario I

    You develop feature A for customer A, and feature B for customer B.

    If those features do not share code they should be kept in the respective develop-* branches, e.g. feature A will be developed in develop-customer-A and feature B in develop-customer-B

    If those features share code the shared part should be developed on the shared develop and the parts specific to the customers in their respective branches develop-*

    0 讨论(0)
提交回复
热议问题