The video by Nick Chapsas "Getting started with branching workflows, Git Flow and GitHub Flow" provides a summary of these two workflows.
<iframe width="560" height="315" src="https://www.youtube.com/embed/gW6dFpTMk8s?si=H6Hhn5CDRE5BLNSD" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>Git Flow is a branching model that helps teams manage their codebase more efficiently.
It's like having a playbook for how to organize your work and collaborate with others on a project.
Here's how it works:
-
Main Branches: There are two main branches:
-
main(ormaster): This is the branch that contains the production-ready code. -
develop: This is the branch where all the new features and bug fixes are integrated before being merged into themainbranch.
-
-
Supporting Branches: There are also supporting branches for specific tasks:
-
featurebranches: These branches are used to develop new features. When a feature is complete, it is merged back into thedevelopbranch. -
releasebranches: When thedevelopbranch is stable and ready for a release, areleasebranch is created from it. This is where any last-minute bug fixes or documentation updates are made before the release is merged into themainbranch and tagged with a version number. -
hotfixbranches: These branches are used to quickly fix critical issues in the production code (masterbranch). When the fix is complete, it is merged back into both themainanddevelopbranches.
-
This workflow helps keep the main branch stable, while allowing active development to happen in parallel on the develop branch and other supporting branches.
GitHub Flow is a simpler branching model compared to Git Flow.
It's designed to work well with GitHub's features and allows for more frequent deployments.
Here's how it works:
-
Main Branch: There is only one main branch, typically called
mainormaster. -
Feature Branches: Whenever you want to work on a new feature or bug fix, you create a new branch from the
mainbranch. -
Pull Requests: When you're ready to merge your changes back into the
mainbranch, you create a Pull Request. This allows others to review your code and provide feedback before merging. -
Code Reviews: The Pull Request triggers a code review process, where team members can discuss the changes, suggest improvements, or request additional changes.
-
Merge and Deploy: Once the code has been reviewed and approved, the feature branch is merged into the
mainbranch. This merged code can then be deployed to production.
GitHub Flow encourages frequent, small updates to the codebase, making it easier to manage and integrate changes.
The references show details of any articles, videos and other items that were used in this chapter, plus other, possibly useful items.
Chapsas, N. (2021). Getting started with branching workflows, Git Flow and GitHub Flow. [online] www.youtube.com. Available at: https://www.youtube.com/watch?v=gW6dFpTMk8s [Accessed 15 Mar. 2024].
Git Dailies (n.d.). Guide to Git Flow. [online] GitDailies: Software Engineering Metrics Made Easy. Available at: https://gitdailies.com/articles/git-flow-guide/ [Accessed 15 Mar. 2024].
Other links
- Git Workflow | Atlassian Git Tutorial
- How To Use Git Flow Effectively (marketsplash.com)
- Git Flow | Developer Experience Knowledge Base
- Getting started with Git using SourceTree - YouTube
- The Gitflow Release Branch from Start to Finish (youtube.com)
- What is Git Flow | How to use Git Flow | Learn Git (gitkraken.com)
- git-flow cheatsheet (danielkummer.github.io)
- A successful Git branching model » nvie.com
- GitHub Flow: A Quick 5-Step Process (hubspot.com)
- Intro to GitHub Flow - GitHub Education
- Understanding GitHub Flow: A Comprehensive Guide (gyata.ai)
- Understanding the GitHub Flow | GitHub Guides (gitbooks.io)
- Git Flow vs GitHub Flow | Alex Hyett
- Git Flow vs GitHub Flow: What You Need to Know (youtube.com)
- ...