Taro Logo

How to choose the appropriate git branching model for your project?

Profile picture
Anonymous User at Taro Communitya year ago

When starting a new development project, how do you choose the version control branching model that is most appropriate for your team to use? I am talking about git flow vs github flow vs gitlab flow vs trunk-based etc ...

What makes you choose one over the other?



(1 comment)
  • 3
    Profile picture
    Meta, Robinhood, Baidu
    a year ago

    If it's an Internet service with a monotonic version number, just use trunk-based. Everything needs to be rebased onto the main/master branch (aka trunk).

    The reason is your version number never goes backward. You won't upgrade v2.1.1 to v2.1.2 but also need to apply the same patch to v1.9.0 and v2.0.9. Client-side software is different. If you have older versions out there you'd better take care of the security patches. Then you will have to apply the same security patch to v1.9.0, v2.0.9, and v2.1.1. That's where multiple live branches become valuable. Otherwise, keeping multiple long-live branches is a cost without much return.

    If your version number never goes backward, you can keep rebasing all new commits to the trunk. You can tag new versions on the trunk and release them. A well set up CI/CD pipeline will make things automatic most of the time.