What if your team could work together without ever overwriting each other's work by accident?
Why Gitflow workflow? - Purpose & Use Cases
Start learning this pattern below
Jump into concepts and practice - no test required
Imagine you and your friends are writing a big story together, but everyone is editing the same paper at once without any plan.
It quickly becomes confusing who wrote what, and fixing mistakes means erasing others' work.
Working without a clear plan causes lost changes, accidental overwrites, and lots of time spent fixing errors.
It's like trying to build a puzzle with pieces from different boxes mixed up.
Gitflow workflow gives you a clear map for working together.
It separates your work into branches like 'main' for finished parts, 'develop' for ongoing work, and special branches for new features or fixes.
This way, everyone knows where to add their changes safely without breaking the story.
git commit -am "fix bug"git checkout -b feature/new-idea
git add .
git commit -m "add new idea"
git checkout develop
git merge feature/new-ideaIt enables smooth teamwork where many people can build, test, and improve code without stepping on each other's toes.
A software team uses Gitflow to add new features, fix bugs, and prepare releases in an organized way, so the app stays stable and improves steadily.
Manual collaboration causes confusion and errors.
Gitflow organizes work into clear branches for safety and clarity.
This workflow helps teams deliver better software faster and with less stress.
Practice
develop branch in the Gitflow workflow?Solution
Step 1: Understand the role of the develop branch
The develop branch is where all completed features are merged and tested together before release.Step 2: Compare with other branches
The master branch holds production-ready code, hotfix branches fix urgent bugs, and experimental code is not part of Gitflow standard branches.Final Answer:
It serves as the integration branch for features before release. -> Option AQuick Check:
Develop = integration branch [OK]
- Confusing develop with master branch
- Thinking develop is for hotfixes
- Assuming develop holds only stable code
login using Gitflow?Solution
Step 1: Recall Gitflow feature start syntax
The correct syntax to start a feature branch isgit flow feature start <name>.Step 2: Check each option
Only git flow feature start login matches the correct syntax exactly. Others have incorrect order or missing 'flow'.Final Answer:
git flow feature start login -> Option BQuick Check:
Feature start = git flow feature start [OK]
- Omitting 'flow' in the command
- Swapping command word order
- Using 'git start' instead of 'git flow feature start'
git flow release start 1.0.0 git flow release finish 1.0.0
Solution
Step 1: Understand what 'git flow release finish' does
This command merges the release branch into bothmasteranddevelop, tags the release, and deletes the release branch.Step 2: Identify the branch after finishing release
After finishing, Gitflow switches tomasterbranch by default.Final Answer:
The branch is switched tomaster. -> Option AQuick Check:
Release finish switches to master [OK]
- Assuming branch stays on release
- Thinking it switches to develop
- Confusing feature branches with release
git flow feature finish login but your changes are not in develop. What is the likely problem?Solution
Step 1: Recall feature branch base in Gitflow
Feature branches should start fromdevelopto ensure changes merge back there.Step 2: Analyze why changes are missing in develop
If the feature branch was started frommaster, finishing it merges changes into master, not develop, causing missing updates in develop.Final Answer:
You started the feature branch from master instead of develop. -> Option CQuick Check:
Feature base must be develop [OK]
- Assuming finishing auto-pushes changes
- Not committing before finishing
- Confusing master and develop as base
Solution
Step 1: Understand hotfix purpose in Gitflow
Hotfix branches are created frommasterto quickly fix production bugs, independent of ongoing releases.Step 2: Check command sequence for hotfix
Starting and finishing a hotfix withgit flow hotfix startandgit flow hotfix finishis the correct way, regardless of release status.Step 3: Evaluate options
git flow hotfix start fix-bug; git flow hotfix finish fix-bug correctly starts and finishes the hotfix. git flow release finish; git flow hotfix start fix-bug; git flow hotfix finish fix-bug delays hotfix until release finishes, which is not required. git flow feature start fix-bug; git flow feature finish fix-bug uses feature instead of hotfix. git flow hotfix start fix-bug; git flow release finish; git flow hotfix finish fix-bug incorrectly mixes release finish before hotfix finish.Final Answer:
git flow hotfix start fix-bug; git flow hotfix finish fix-bug -> Option DQuick Check:
Hotfix runs independently during release [OK]
- Waiting for release to finish before hotfix
- Using feature branch for hotfix
- Finishing release before hotfix finish
