Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Gitflow Workflow Basics
📖 Scenario: You are working on a software project with a team. To keep your work organized, you use the Gitflow workflow. This workflow helps you manage new features, fixes, and releases in a clean way.
🎯 Goal: You will create the main branches used in Gitflow, add a feature branch, merge it back, and finally prepare a release branch. This will help you understand how Gitflow keeps your project organized.
📋 What You'll Learn
Create the develop branch from main
Create a feature branch called feature/login from develop
Merge feature/login back into develop
Create a release branch called release/1.0.0 from develop
Show the list of branches at the end
💡 Why This Matters
🌍 Real World
Teams use Gitflow to keep their code organized when many people work on different features and fixes at the same time.
💼 Career
Understanding Gitflow is important for software developers and DevOps engineers to collaborate smoothly and manage releases efficiently.
Progress0 / 4 steps
1
Create the develop branch from main
Create a new branch called develop from the existing main branch using the command git branch develop main.
Git
Hint
Use git branch develop main to create the develop branch from main.
2
Create a feature branch called feature/login from develop
Create a new branch called feature/login from the develop branch using the command git branch feature/login develop.
Git
Hint
Use git branch feature/login develop to create the feature branch from develop.
3
Merge feature/login back into develop
Switch to the develop branch using git checkout develop, then merge the feature/login branch into develop using git merge feature/login.
Git
Hint
First switch to develop with git checkout develop, then merge with git merge feature/login.
4
Create a release branch called release/1.0.0 from develop and list branches
Create a new branch called release/1.0.0 from develop using git branch release/1.0.0 develop. Then list all branches using git branch.
Git
Hint
Use git branch release/1.0.0 develop to create the release branch, then git branch to see all branches.
Practice
(1/5)
1. What is the main purpose of the develop branch in the Gitflow workflow?
easy
A. It serves as the integration branch for features before release.
B. It contains the production-ready code only.
C. It is used to fix urgent bugs directly in production.
D. It stores experimental code that is not stable.
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 A
Quick Check:
Develop = integration branch [OK]
Hint: Develop branch integrates features before release [OK]
Common Mistakes:
Confusing develop with master branch
Thinking develop is for hotfixes
Assuming develop holds only stable code
2. Which command correctly starts a new feature branch named login using Gitflow?
easy
A. git flow start feature login
B. git flow feature start login
C. git start feature login
D. git feature start login
Solution
Step 1: Recall Gitflow feature start syntax
The correct syntax to start a feature branch is git 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 B
Quick Check:
Feature start = git flow feature start [OK]
Hint: Use 'git flow feature start <name>' to start features [OK]
Common Mistakes:
Omitting 'flow' in the command
Swapping command word order
Using 'git start' instead of 'git flow feature start'
3. Given the commands below, what is the final branch after finishing a release?
Step 1: Understand what 'git flow release finish' does
This command merges the release branch into both master and develop, tags the release, and deletes the release branch.
Step 2: Identify the branch after finishing release
After finishing, Gitflow switches to master branch by default.
Final Answer:
The branch is switched to master. -> Option A
Quick Check:
Release finish switches to master [OK]
Hint: Release finish merges and switches to master [OK]
Common Mistakes:
Assuming branch stays on release
Thinking it switches to develop
Confusing feature branches with release
4. You ran git flow feature finish login but your changes are not in develop. What is the likely problem?
medium
A. You forgot to push the develop branch after finishing the feature.
B. You did not commit changes before finishing the feature.
C. You started the feature branch from master instead of develop.
D. You finished the feature on the master branch.
Solution
Step 1: Recall feature branch base in Gitflow
Feature branches should start from develop to ensure changes merge back there.
Step 2: Analyze why changes are missing in develop
If the feature branch was started from master, 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 C
Quick Check:
Feature base must be develop [OK]
Hint: Feature branches must start from develop [OK]
Common Mistakes:
Assuming finishing auto-pushes changes
Not committing before finishing
Confusing master and develop as base
5. Your team wants to prepare a hotfix for a critical bug in production while a release is in progress. According to Gitflow, which sequence of commands correctly handles this situation?