Skip to content

hughedward/gitflow-skills

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

GitFlow Skill 🦭

image

License: MIT Git

Git Flow Branching Model β€” Implemented with pure Git, no additional tools required

A Claude Code skill that helps you follow the Git Flow workflow. Supports custom branch names, interactive operations, and is fully portable.


Quick Start

Installation

Method 1:

npx skills add https://github.com/hughedward/gitflow-skills --skill gitflow

Method 2:

# Clone the repository
git clone https://github.com/hughedward/gitflow-skills.git /tmp/gitflow-skills

# Copy the skill to your Claude Code skills directory
mkdir -p ~/.agents/skills
mkdir -p ~/.claude/skills
cp -r /tmp/gitflow-skills/skills/gitflow ~/.agents/skills
ln -s ~/.agents/skills/gitflow ~/.claude/skills/

# Done! Type /gitflow in Claude Code to use it

Basic Usage

Type in Claude Code:(All you need to do)

/gitflow [balabala]

The skill will guide you through Git Flow operations.

You can optionally configure a .gitflow file in your project root:

# Git Flow Configuration
# This file is generated by setup_gitflow.sh
# Modify these values to customize your branch names

[gitflow "branch"]
    master = main
    develop = develop

[gitflow "prefix"]
    feature = feature/
    release = release/
    hotfix = hotfix/

Features

Feature Description
Pure Git Implementation No need to install git-flow-avh or other tools
Interactive Menu Friendly command-line interface, no need to memorize complex commands
Custom Configuration Support for custom branch names (e.g., dev instead of develop)
Status Visualization Understand your Git Flow status at a glance
Regression Testing Built-in test suite to ensure script reliability

Usage Guide (Read to the end)

Official documentation: https://nvie.com/posts/a-successful-git-branching-model/

Initialize Repository

# Ensure main branch exists
git checkout main

# Create develop branch
git checkout -b develop

# Push to remote
git push -u origin main
git push -u origin develop

Or use the helper script:

bash ~/.claude/skills/gitflow/scripts/setup_gitflow.sh

Develop New Features

# Create feature branch from develop
git checkout develop
git checkout -b feature/user-auth

# ... develop code ...

# Merge back to develop when done
git checkout develop
git merge --no-ff feature/user-auth
git branch -d feature/user-auth

Release Version

# Create release branch from develop
git checkout develop
git checkout -b release/1.0.0

# ... release preparation ...

# Merge to main and tag
git checkout main
git merge --no-ff release/1.0.0
git tag -a 1.0.0 -m "Release version 1.0.0"

# Merge back to develop
git checkout develop
git merge --no-ff release/1.0.0
git branch -d release/1.0.0

# Push tags
git push origin main
git push origin develop
git push origin 1.0.0

Production Hotfix

# Create hotfix branch from main
git checkout main
git checkout -b hotfix/1.0.1

# ... fix bug ...

# Merge to main and tag
git checkout main
git merge --no-ff hotfix/1.0.1
git tag -a 1.0.1 -m "Hotfix version 1.0.1"

# Merge back to develop
git checkout develop
git merge --no-ff hotfix/1.0.1
git branch -d hotfix/1.0.1

🦭: Above is just knowledge, you don't actually need to worry about anything

Just type in Claude Code: Let the skill handle the rest

/gitflow

🦭:πŸ˜›


Helper Scripts

Script Purpose
setup_gitflow.sh Initialize Git Flow repository
gitflow_helper.sh Interactive operation menu
gitflow_status.sh Display current Git Flow status

Branch Structure

Branch Purpose Source Merge To
main / master Production - -
develop Development integration main -
feature/* New feature development develop develop
release/* Release preparation develop develop, main
hotfix/* Production emergency fixes main develop, main

Git Flow Philosophy

Git Flow is a branching model strategy proposed by Vincent Driessen.

https://nvie.com/posts/a-successful-git-branching-model/

Core concept: Git Flow is a set of branch management conventions, not a specific tool. Understanding the underlying Git commands allows you to use it in any environment without depending on additional software.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Git Flow Philosophy  β†’  Implemented with native git  βœ“ β”‚
β”‚  Git Flow Tool  β†’  Optional, not required (optional)   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Configuration

The .gitflow configuration file in the project root stores branch naming preferences:

[gitflow "branch"]
    master = main
    develop = develop
[gitflow "prefix"]
    feature = feature/
    release = release/
    hotfix = hotfix/

All helper scripts will automatically read and respect this configuration.


System Requirements

  • Git 2.0+
  • Bash 4.0+

FAQ

Q: Do I need to install git-flow-avh tool?

A: No. This skill implements all features using pure Git commands.

Q: Can I customize branch names?

A: Yes. Modify the .gitflow configuration file.

Q: What if develop branch doesn't exist?

A: Run git checkout main && git checkout -b develop to create it.


License

MIT License


Contributing

Issues and Pull Requests are welcome!


Star History Chart

About

gitflow-skills - Git Flow workflow for Claude Code & OpenClaw. No extra tools needed, pure Git implementation.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages