git-workflow
Guide git operations using a three-tier branching model (main → staging → feature). Use this skill when the user asks about git commands, branch strategy, PRs, rebasing, merging, deploying to production, hotfixes, or conflict resolution. Triggers include "git", "commit", "branch", "PR", "rebase", "merge", "deploy", "staging", "feature branch", "hotfix".
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
Git Workflow
Three-tier branching: main (production) → staging (integration) → feature/* (development).
Core Workflow
Start Feature
git feature <name>
Creates feature/<name> from latest staging.
During Development
git add -A && git commit -m "WIP: description"
git sync # daily - rebases on staging
Before PR
git rebase -i origin/staging # clean WIP commits
bun build && bun lint # verify
git push origin feature/xxx --force-with-lease
gh pr create --base staging --title "feat: description"
Merge PR
GitHub → Squash and merge
Deploy to Production
git checkout main && git pull
git merge staging --ff-only
git push origin main
After Deploy (sync staging)
git checkout staging && git pull
git merge origin/main --ff-only
git push origin staging
Merge Strategy Rules
| Route | Method | Why |
|---|---|---|
| feature → staging | Squash (GitHub PR) | Clean history |
| staging → main | Fast-forward or merge commit | Preserves feature commits |
Never squash staging → main — breaks history connection.
Quick Reference
For detailed commands, see references/commands.md:
- Hotfix workflow
- Conflict resolution
- Emergency recovery
- Weekly maintenance
Conventional Commits
type(scope): description
Types: feat fix refactor chore docs test perf
Scopes: Project-specific (e.g., cart, api, checkout, schema)
Aliases
| Alias | Action |
|---|---|
git sync |
Rebase on origin |
git feature <name> |
Create feature branch |
git cleanup |
Delete merged branches |
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-01-20
- 索引更新时间
- 2026-03-03
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!