Recently I’ve spent time to study a good way to manage a software project with GIT. I really read a lot of blog posts 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

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 with Mary in writing an article to collaborate with Mary in writing an article.

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 Implemented in the Develop branch it’s implemented When all the features related to a new release Time to branch the code to the release branch where 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 Apparently it could seem to much steps but it’s for sure quite safe and helps you to avoid mistakes or problems 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 Atlassian that 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 to use this 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 master branch is deployable
  • To work on something new, create a descriptively named branch off of master (ie:new-oauth2-scopes)
  • 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:

If you have any other method to manage your project in GIT feel free to share because I’m quite interesting to see how you usually work with GIT and if there are better ways to work with and if you have any other feedback or question I’m here for you!

Like this:

Like Loading…

Related