Gitflow with multiple master branches

16,950

If 99% of the code is shared between the two products, you could easily share the same repository. You can have a single release/develop/master branch as long as the two products are on the same release cycle e.g., version 2.0 ships at the same time.

From the master branch, would I create a "Server Release" and "Local Release" branch?

In gitflow you actually branch releases from develop! But in the case that they are on different release cycles, there's nothing stopping you from creating a release branch per product. Then you are free to merge the release branches in to the develop and master branches when they are done on their own time. The only thing here is that you will likely need to have two different flavors of tags on the master branch so that you can see where each product is on its release cycle. Or to keep the tags in the same format, you may have two master branches (one per product), which you merge into respectively when a feature is completed for the respective product.

Share:
16,950

Related videos on Youtube

BuvinJ
Author by

BuvinJ

Windows C++ w/ Qt, w/ MFC Python w/ Tkinter & wx Java w/ Swing, J++ VB6 macOS C++ w/ Qt Objective-C Python w/ Tkinter & wx Linux Desktop C++ w/ Qt Python w/ Tkinter & wx Embedded C++ w/ Qt Java w/ Android iOS Objective-C C++ w/ Qt Android Java w/ Android C++ w/ Qt Linux Server Python w/ Twisted Java RPC PHP Windows Server ASP.NET w/ C# Classic ASP w/ ADO VB6 w/ActiveX DLLs Client-Side Web Java GWT JavaScript VBScript HTML5 CSS3 Windows Console C++ w/ STL Python Batch VBScript Linux Console Bash Python PeopleSoft 7 & 8 PeopleCode SQR Installers InstallShield 2013 MSI & w/ InstallScript Qt Installer Framework InstallScript for VC++ 6 NSIS Databases MySQL 4.0 - 5.7 MariaDB SQL Server 2008 - 2012 Oracle 8.x QODBC dBase IV IDEs Qt Creator 2.8 - 4.3 /w Qt 5.1 - 5.11 Visual Studio 6, 2003 - 2012 Eclipse I - 2018 PyDev X-Code 4.x - 8.x Idle PeopleTools 7.0 - 8.1 Cold Moon (Proprietary) 1.0 - 3.0 Source Control Git Tortoise Git Source Tree Git Gui Git-Cola GitKraken Assembla BitBucket / Jira GitHub Servers Apache Tomcat Python (custom) IIS 6.0 - 7.5 Webmin Plesk Platforms Windows 10/8.1/8/7/Vista/XP/2008/2003/2000/NT/ME/9x/3x macOS 10.7 - 10.14 Linux: Ubuntu, CentOS, Debian, Yocto iOS 5.0 - 10.x Android 2.0 - 6.x DOS 5+ Miscellaneous SQL Ajax JSON XML SOAP REST QBasic Intel Assembly Additional Exposure BitBake AOSP VB.NET JQuery Perl Apple Script PowerShell Source Safe SVN PostgreSQL OpenSSL Sage CRM/ERP QuickBooks GoldMine Method CRM

Updated on June 11, 2022

Comments

  • BuvinJ
    BuvinJ almost 2 years

    While this is similar to the thread Git-flow and master with multiple parallel release-branches and to What's best way to work with git on multiple master branch?, it is not quite identical... I did find this one is rather similiar: Multiple projects with same GIT master, but I want discuss my specific use case...

    The company I work for is in the process establishing policies and procedures for our Git work flow. We want to use the "Gitflow" model as described in the article http://nvie.com/posts/a-successful-git-branching-model/ or https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow and is commonly referenced in many discussions on the matter.

    We have a use case, however, with a requirement for which I cannot find a solution documented. What if your project is used to produce more than one final product? The master branch cannot therefore represent the "release points" as if it were one single product. It seems that perhaps alternate branches are required from the master? So multiple parallel release branches?

    For instance, what if the project acts as a backbone or engine to something that can have different skins, flavours, or variations but you want to have each of the full resulting final products stored in one repository?

    In my particular scenario, I have a program which runs on a Linux server, but it is also distributed as a local Windows application. In these differing versions, there are large chunks of the project which may or may not be included in one or the other releases. As an example, there are libraries on the server which do not need to be included if the repo was for the server only, but which must be included for the local distribution where they would not otherwise exist. I want to pull updates to the repo onto the server at specific release points, but omit such pieces that don't belong there.

    From the master branch, would I create a "Server Release" and "Local Release" branch?

    Where would the development branch (and it's features) then come off of? I don't want multiple development branches, each coming from it's own release, as the code developments are in fact 99% applicable to both of those. Do I need to merge a single dev branch into one and then the other release?

  • mstrap
    mstrap over 8 years
    I agree. If the code is more or less identical, have one repository and just add different deployment scripts/tools (e.g. antfiles) into this repository as well. Git-Flow should work well here.
  • BuvinJ
    BuvinJ over 8 years
    Thanks mvd. That helps. I am still learning about this branching model, and I was clearly led astray on Gitflow by looking at secondary sources. Looking at the primary source instead, I saw how release branches are temporary, and come off of develop. I had though release was a permanent middle man which originally came from master, and then dev came from that. As a result, my proposed solution was quite mucked up. I like the 2 master branch idea. It's similar to what I truly meant. I am conversing with the team here about this now. I'll except this answer if we implement your plan.
  • mvd
    mvd over 8 years
    There are other models where release branches are long-lived. Work starts on develop, gets merged into master (once it's considered stable enough to test) and a release branch gets branched off master when the .0 tag is being tagged. Don't feel like you have to go with git-flow because it is popular! You have a unique situation and in the end you should choose a strategy that works best for your company.
  • BuvinJ
    BuvinJ over 8 years
    Interesting. We are trying to establish a standard model for all of our projects. Gitflow seems like a great starting point. This project, however, doesn't seem to fit the "standard mold", so we need to tweak it, but ideally diverge as little as possible. As you suggest, I will try not be too bound up by the popular standard though.
  • CME64
    CME64 over 7 years
    this doesn't seem right, it's better to use the same flow for sub/custom products so you will have other develop & master branches too