Git Flow vs Github Flow

Git Flow vs Github Flow

Git Flow vs Github Flow

Recently I’ve spent time to study a good way to manage a software projects with GIT.
I really read a lots of blog post to check different points of view and to find out which is the best technique to use in different situations.

The principals ways to manage a software in GIT are: the Git Flow and the Github Flow.
These 2 methods can really help you to manage your project and optimise your workflow in the team.
Let’s see the differences between them.

Git Flow

Git flow works with different branches to manage easily each phase of the software development, it’s suggested to be used when your software has the concept of “release” because, as you can see in the scheme above, it’s not the best decision when you work in Continuous Delivery or Continuos Deployment environment where this concept is missing.

Another good point of this flow is that fits perfectly when you work in team and one or more developers have to collaborate to the same feature.
But let’s take a look closer to this model.

The main branches in this flow are:

  • master
  • develop
  • features
  • hotfix
  • release

When you clone a GIT repository in your local folder you have immediately to create a branch from the master called develop, this branch will be the main branch for the development and where all the developers in a team will work to implement new features or bug fixing before the release.
Every time a developer needs to add a new feature he will create a new branch from develop that allow him to work properly in that feature without compromise the code for the other people in the team in the develop branch.
When the feature will be ready and tested it could be rebased inside the develop branch, our goal is to have always a stable version of develop branch because we merge the code only when the new feature is completed and it’s working.
When all the features related to a new release are implemented in the develop branch it’s time to branch the code to the release branch where there you’ll start to test properly before the final deployment.
When you branch your code from develop to release you should avoid to add new features but you should only fix bugs inside the release branch code until to you create a stable release branch.
At the end, when you are ready to push live deploy live your project, you will tag the version inside the master branch so there you can have all the different versions that you release week by week.
Apparently it could seem to much steps but it’s for sure quite safe and helps you to avoid mistakes or problem when you release, obviously to accomplish all this tasks you can find online a lots of scripts that could help you to work with Git flow in the command line or if you prefer you can use visual tools like SourceTree by Atlassianthat make the dirty work for you, so you have to follow only the instructions inside the software to manage all the branches, for this reason I’ve also prepared a short video to see how use Git flow with SourceTree

You can go more in deep about this flow reading these 2 interesting articles: nvie blog or datasift documentation.

Github Flow



So now, do you think that Github is working with Git Flow? Of course no! (Honestly I was really surprised when I read that!)
In fact they are working with a continuos deployment environment where there isn’t the concept of “release” because every time they finish to prepare a new feature they push live immediately (after the whole automation chain created in the environment).
The main concepts behind the Github flow are:

  • Anything in the  branch is deployable
  • To work on something new, create a descriptively named branch off of  (ie:)
  • Commit to that branch locally and regularly push your work to the same named branch on the server
  • When you need feedback or help, or you think the branch is ready for merging, open a pull request
  • After someone else has reviewed and signed off on the feature, you can merge it into master
  • Once it is merged and pushed to ‘master’, you can and should deploy immediately

I found an amazing interactive page where you can deepen the knowledge of this method, but I see it’s very common when you work in QA teams, small teams or you are working as freelance because it’s true that is a lightweight flow to manage a project but it’s also quite clear and secure when you want to merge your code in the master branch.
Another good resource about Github Flow is the blog post made by the Github evangelist Scott Chacon.
I recorded also a video on how to use Github flow with SourceTree

Ehsan Elhampour

Experienced Full-Stack Engineer | Expert in .NET, JavaScript, Python & DevOps | Building Scalable & Innovative Solutions

8 年

really helpful , thank you.

要查看或添加评论,请登录

Luca Mezzalira的更多文章

  • The data recovery challenge in the cloud era

    The data recovery challenge in the cloud era

    In today’s digital-first world, businesses are generating and storing data at an unprecedented scale. With the rise of…

    1 条评论
  • Instant recovery strategies for S3 and DynamoDB in the AI era

    Instant recovery strategies for S3 and DynamoDB in the AI era

    A few weeks ago, I had the opportunity to attend the SHIFT conference organized by Commvault, and it was quite an…

    1 条评论
  • How Micro-Frontends are reshaping Modern Web Architecture

    How Micro-Frontends are reshaping Modern Web Architecture

    Are you frustrated with slow deployment cycles, tightly coupled dependencies, and the cumbersome nature of managing…

    5 条评论
  • How to Document Software Architecture: Techniques and Best Practices

    How to Document Software Architecture: Techniques and Best Practices

    In software development, documentation is often overlooked in favor of coding. However, documenting software…

    32 条评论
  • Unlocking the Power of Your Second Brain

    Unlocking the Power of Your Second Brain

    Ever feel like you’re drowning in information and struggling to keep up? You’re not alone. The secret to thriving in…

    5 条评论
  • My Personal productivity hacks with Apple Devices

    My Personal productivity hacks with Apple Devices

    Smartphones, tablets, smartwatches — all are competing to grab our attention. The problem is that when it happens, it…

    3 条评论
  • Micro-frontends, the future of Frontend architectures

    Micro-frontends, the future of Frontend architectures

    In the past 30 months, I had the opportunity to work on one of the most challenging architectures I’ve ever designed in…

    2 条评论
  • The first book on Front-end Reactive Architectures

    The first book on Front-end Reactive Architectures

    When I proposed this book the first time a couple of years ago, Reactive Programming wasn’t “a thing” yet in the…

    5 条评论
  • The art of coding

    The art of coding

    The art of coding Today I spent few hours in my favourite London museum: The Design Museum. I went to the main…

    1 条评论
  • HTTP2: the good, the bad, the ugly

    HTTP2: the good, the bad, the ugly

    I spent last few weeks investigating on HTTP2, the successor of HTTP1.1 and I’d like to share my findings and thoughts…

    4 条评论

社区洞察

其他会员也浏览了