3  Gitflow

Git is the version control system that underlies GitHub. Gitflow is an alternative git branching model that uses feature branches and multiple primary branches (vs one primary branch, e.g., “main”).

Gitflow was originally proposed by Vincent Driessen in 2010 on his blog. A tutorial by the tech company Atlassian has a nice overview of Gitflow.

In Gitflow there are two primary branches: main and dev (see diagram below). Feature branches always branch off of dev. After feature branches merge back into dev, then dev is merged into main.

%%{init: { 'logLevel': 'debug', 'theme': 'default', 'themeVariables': {
  'git0': '#57bfd3',
  'git1': '#5F9157',
  'git2': '#f4b840',
  'git3': '#D26D6D'
} } }%%
gitGraph
   commit tag: "v1.0"
   commit
   branch dev
   checkout dev
   commit
   branch feature1
   checkout feature1
   commit
   commit
   checkout dev
   branch feature2
   checkout feature2
   commit
   commit
   checkout dev
   merge feature1
   checkout main
   merge dev
   commit tag: "v2.0"

There are formal tools for using a Gitflow model, e.g., nvie/gitflow. However, we aren’t using that tool or any others at the moment.

There is one component of Gitflow that we do not use right now: release branches.

3.1 Further reading

(Taken from https://github.com/nvie/gitflow)

Reading: http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/

Screen casts: