Followers

Git Flow Commands

  🧠 What is Git Flow? Git Flow is a branching model created by Vincent Driessen. It organizes work into different branch types , each wi...

 

🧠 What is Git Flow?

Git Flow is a branching model created by Vincent Driessen.
It organizes work into different branch types, each with a clear purpose.

Here’s the structure:

BranchPurpose
mainAlways production-ready code
developOngoing development (integration branch)
feature/*New features
release/*Preparing a new version for production
hotfix/*Urgent fixes for production issues
support/*(Optional) Long-term maintenance branches

⚙️ Installing Git Flow

If you’re on Windows, install it like this (after Git is installed):

🪟 Windows

  1. Open Git Bash.

  2. Run:

    git flow init

Git Flow is now ready — this initializes the workflow structure in your repo.


🚀 Git Flow Command Guide (with Examples)

Let’s go through the main commands you’ll use 👇


🟩 1. git flow init

Purpose: Initializes Git Flow in your repository.

Command:

git flow init

You’ll be asked a few questions:

  • Branch name for production releases? → main

  • Branch name for "next release"? → develop

  • Prefix for features, releases, etc. (press Enter to accept defaults)

After that, Git Flow will:

  • Create develop from main

  • Set up prefixes like feature/, release/, and hotfix/

✅ Now your repo has:

main develop

🟨 2. git flow feature start <name>

Purpose: Start a new feature branch from develop.

Example:

git flow feature start login-page

This creates and switches to a new branch:

feature/login-page

You can now code your feature.

After finishing the feature:

git add . git commit -m "Add login page"

🟦 3. git flow feature finish <name>

Purpose: Finish your feature and merge it into develop.

Example:

git flow feature finish login-page

Git Flow will:

  • Merge feature/login-pagedevelop

  • Delete the feature branch


🟪 4. git flow release start <version>

Purpose: Prepare a release branch from develop.

Example:

git flow release start v1.0

This creates a branch:

release/v1.0

You can now:

  • Update version numbers

  • Do final testing, bug fixing, etc.

When ready to release:

git flow release finish v1.0

This will:

  • Merge release/v1.0main

  • Tag the release as v1.0

  • Merge release/v1.0develop

  • Delete the release branch


🟥 5. git flow hotfix start <name>

Purpose: Create a quick fix for production directly from main.

Example:

git flow hotfix start fix-login-error

You fix the bug and commit:

git commit -am "Fix login error on production"

Finish the hotfix:

git flow hotfix finish fix-login-error

Git Flow will:

  • Merge fix into main

  • Tag a new release (e.g. v1.0.1)

  • Merge fix back into develop

  • Delete the branch


🧩 6. (Optional) git flow support start <name>

Used for long-term maintenance versions (rare).
Example:

git flow support start 1.0.x

🧭 Summary Table

CommandDescriptionMerges Into
git flow initInitialize Git Flow structure
git flow feature start <name>Start new featureFrom develop
git flow feature finish <name>Merge featureInto develop
git flow release start <version>Start release prepFrom develop
git flow release finish <version>Merge releaseInto main + develop
git flow hotfix start <name>Start urgent production fixFrom main
git flow hotfix finish <name>Merge hotfixInto main + develop

💻 Example Real Workflow

# 1️⃣ Init project git flow init # 2️⃣ Start a new feature git flow feature start login # work, then git add . git commit -m "Add login feature" git flow feature finish login # 3️⃣ Start a release git flow release start v1.0 # bump version numbers, then git flow release finish v1.0 # 4️⃣ Urgent fix git flow hotfix start v1.0.1 # fix bug git commit -am "Fix production issue" git flow hotfix finish v1.0.1

COMMENTS

Name

Ansible,6,AWS,1,Azure DevOps,1,Containerization with docker,2,DevOps,2,Docker file with buildkit,1,Docker file with buildx,1,Docker Image Scan,1,Docker Quiz,1,Docker Quizzes,1,Docker Swarm,1,DockerCompose,1,ELK,2,git,2,git quiz,1,Git Worksheet,1,headless service DNS service record,1,ITIL,1,ITSM,1,Jira,3,Kubernetes,1,Kubernetes Quiz,5,SAST DAST Security Testing,1,SDLC Quiz,5,SonarQube,3,Splunk,2,vagrant kubernetes,1,Windows,1,YAML Basics,1,
ltr
item
DevOpsWorld: Git Flow Commands
Git Flow Commands
DevOpsWorld
https://www.devopsworld.co.in/2025/11/git-flow-commands.html
https://www.devopsworld.co.in/
https://www.devopsworld.co.in/
https://www.devopsworld.co.in/2025/11/git-flow-commands.html
true
5997357714110665304
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Content