Helps you use the abc-git-flow tool to manage git branches when developing requirements or fixing bugs.
⚠️ Note for Claude Code users: Some
git abccommands require interactive input and do not work properly in Claude Code.It is recommended to use the provided Python scripts(see the non-interactive commands section below) to avoid terminal blocking.
Installation
npx add-skill https://github.com/ABCFed/claude-marketplace/tree/main/skills/git-flow
Install abc-git-flow
macOS
sudo curl https://cis-static-common.oss-cn-shanghai.aliyuncs.com/assets/abc-git-flow/git-abc-flow-install.sh
If an error is reported Bad CPU type, you need to run:
/usr/sbin/softwareupdate --install-rosetta --agree-to-license
Windows
curl -# -O https://static-common-cdn.abcyun.cn/assets/abc-git-flow/install.bat && call install.bat
Linux
curl https://static-common-cdn.abcyun.cn/assets/abc-git-flow/install-linux.sh | sh
Install Python dependencies
pip install requests
Initialization
For first-time use, run the following in the project directory:
git abc init
git abc tag config <前缀> # 配置 tag 前缀,如 pc、charge
Common Commands
Branch naming conventions: See Branch Naming Rulesto learn the correct naming formats for feature, hotfix, and hotfix-g branches.
Feature Development (Feature)
# 开始需求开发 - 从 develop 拉取分支
git abc feature start <feature-name>
# 完成需求开发 - 合并到 develop
git abc feature finish <feature-name>
Production Environment Emergency Fix (Hotfix)
# 开始修复 - 从 master 拉取分支
git abc hotfix start <hotfix-name>
# 完成修复 - 合并到 master/gray/rc/develop
git abc hotfix finish <hotfix-name>
Gray Environment Emergency Fix (Hotfix-g)
# 开始修复 - 从 gray 拉取分支
git abc hotfix-g start <hotfix-name>
# 完成修复 - 合并到 gray/rc/develop
git abc hotfix-g finish <hotfix-name>
RC Branch Management
# 将 develop 合入 rc(上线前)
git abc rc start
# 将 rc 合入 gray
git abc rc finish
Gray Release
# 将 gray 合入 master(灰度到全量)
git abc gray publish
Tag Management
Interactive commands (require filling in information):
# 创建 tag(会提示选择类型并填写信息)
git abc tag create
# 直接指定 tag 类型(但仍需填写上车/提测信息)
git abc tag create v
git abc tag create g
git abc tag create f
# 查看最近 tag
git abc tag show [类型]
# 配置 tag 前缀
git abc tag config [前缀]
Non-interactive scripts (recommended for Claude Code):
# 创建正式环境 tag
~/.claude/skills/git-flow/scripts/tag_create.py v --deps "abc-auth" --operation "无"
# 创建需求提测 tag
~/.claude/skills/git-flow/scripts/tag_create.py f \
--deps "无" \
--operation "无" \
--remark "feat: 实现新功能" \
--tapd-id "1122044681001112866"
# 创建灰度环境 tag
~/.claude/skills/git-flow/scripts/tag_create.py g \
--deps "abc-auth" \
--operation "无"
Detailed description: See tag-create detailed guide, including complete instructions on tag types, branch constraints, command usage, and more.
Merge Request Management
Interactive commands (not recommended):
git abc mr create # 会进入交互式选择
git abc mr config # 配置云效 Token
Non-interactive scripts (recommended for Claude Code):
# 创建 MR(需要先配置 git abc mr config)
~/.claude/skills/git-flow/scripts/mr_create.py \
-t develop \
-T "feat: 新功能开发" \
-r 张三 李四
# 指定描述
~/.claude/skills/git-flow/scripts/mr_create.py \
-t develop \
-T "fix: 修复bug" \
-r 张三 \
-d "修复了xxx问题"
Non-interactive Commands (Recommended for Claude Code)
Since some commands require interactive input, Python script alternatives are provided:
Tag creation script (scripts/tag_create.py)
| Command | Description |
|---|---|
tag_create.py v --deps "xxx" --operation "xxx" |
Create production environment tag |
tag_create.py g --deps "xxx" --operation "xxx" |
Create gray environment tag |
tag_create.py p --deps "xxx" --operation "xxx" |
Create pre-release tag |
tag_create.py f --deps "xxx" --operation "xxx" --remark "xxx" |
Create requirement testing tag |
tag_create.py t --deps "xxx" --operation "xxx" --remark "xxx" |
Create test environment tag |
Full parameters:
tag_type- Tag type (f/t/v/g/p), required--deps- Dependent services--operation- Required operations--remark- Remarks/description--tapd-id- Associated TAPD ID (optional for f tag)-b, --business- Business line (default abc-his)--prefix- Tag prefix (read from git config)--hotfix- Hotfix mode--skipdeploy- Skip onboarding/testing, only create tag
MR creation script (scripts/mr_create.py)
| Parameter | Description | Required |
|---|---|---|
-t, --target |
Target branch | ✅ |
-T, --title |
MR title | ✅ |
-r, --reviewers |
Reviewer name | ✅ |
-d, --description |
MR description | ❌ |
--skip-notify |
Skip WeCom notification | ❌ |
Non-interactive usage guide: See Non-interactive Command Usage Guide
Typical Workflow (Claude Code optimized version)
Requirement Development Workflow
-
Pull a development branch from develop:
git abc feature start <feature-name> -
Proceed with requirement development and coding
-
After development is complete, rebase the develop code and create an f-tag:
git rebase develop ~/.claude/skills/git-flow/scripts/tag_create.py f \ --deps "无" \ --operation "无" \ --remark "feat: 实现新功能" \ --tapd-id "1122044681001112866" -
After the test submission is complete, merge into develop:
git abc feature finish <feature-name> -
Wait for integration testing and create a t-tag:
~/.claude/skills/git-flow/scripts/tag_create.py t \ --deps "无" \ --operation "无" \ --remark "集成测试" -
After integration testing is complete, merge develop into rc and create a p-tag:
git abc rc start ~/.claude/skills/git-flow/scripts/tag_create.py p \ --deps "abc-auth" \ --operation "无"
Production Environment Bug Fix Process
-
Pull a hotfix branch from master:
git abc hotfix start <hotfix-name> -
After fixing, create a t-tag for the tester:
~/.claude/skills/git-flow/scripts/tag_create.py t \ --deps "无" \ --operation "无" \ --remark "hotfix: 修复xxx问题" -
After testing is complete, merge into master/gray/rc/develop:
git abc hotfix finish <hotfix-name>Note: master, gray, rc, and develop need to be pushed to the remote
Gray Environment Bug Fix Process
-
Pull a hotfix-g branch from gray:
git abc hotfix-g start <hotfix-name> -
After fixing, create a t-tag for the tester:
~/.claude/skills/git-flow/scripts/tag_create.py t \ --deps "无" \ --operation "无" \ --remark "hotfix: 修复xxx问题" -
After testing is complete, merge into gray/rc/develop:
git abc hotfix-g finish <hotfix-name>Note: gray, rc, and develop need to be pushed to the remote
Branch Description
Long-term Branches
| Branch | Description |
|---|---|
| master | Stable code for the production environment; cannot be developed on directly |
| gray | Stable code for the gray environment; cannot be developed on directly |
| rc | Pre-release environment branch; merge into gray after completion |
| develop | Base branch for new requirement development; gathers completed features |
| experience | Experience branch; stability is not guaranteed; used to experience the latest features |
Temporary Branches
| Branch | Source | Description |
|---|---|---|
| feature | develop | New feature development branch |
| hotfix | master | Urgent issue fix for the production environment |
| hotfix-g | gray | Urgent issue fix for the gray environment |
Tag Naming Convention
Format:<前缀><年份>.<周数>.<构建号>
| Prefix | Description |
|---|---|
pc-f |
feature submission for testing |
pc-t |
release integration testing |
pc-g |
gray release |
pc-v |
master full release |
Example:pc-g2021.09.03 indicates the third build of the pc project in the ninth week of 2021
Rebase Usage Principles
Recommended usage scenarios:
- Independently developed branches; merge the source branch into this branch
- Local branches synchronize changes from remote branches
Prohibited usage scenarios:
- Requirement branches for multi-person collaboration
Example:
# 自己的需求分支,同步 develop
git rebase develop
# 本地 develop 同步远程
git pull --rebase
Other Commands
# 查看 abc-flow 版本
git abc -v
# 查看帮助
git abc -h
# 更新 git-abc
git abc update
Command Support Comparison
| Operation | Interactive Command | Non-interactive Script | Claude Code Recommendation |
|---|---|---|---|
| Feature Operation | git abc feature start/finish |
- | ✅ Interactive |
| Hotfix Operation | git abc hotfix start/finish |
- | ✅ Interactive |
| RC Operation | git abc rc start/finish |
- | ✅ Interactive |
| Tag Configuration | git abc tag config <前缀> |
- | ✅ Interactive |
| Tag Creation | git abc tag create v |
tag_create.py v --deps xxx |
✅ Non-interactive |
| MR Creation | git abc mr create |
mr_create.py -t xxx -T xxx -r xxx |
✅ Non-interactive |
Tip: In Claude Code, prioritize using non-interactive scripts to create Tags and MRs to avoid terminal blocking.