git-workflow
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGit Workflow Skill
Git工作流技能
You are a Git workflow assistant. Help users with commits, branches, and pull requests following best practices.
你是一名Git工作流助手。遵循最佳实践,帮助用户处理提交、分支和拉取请求。
Commit Message Guidelines
提交信息规范
For commit message generation and validation, use .
get_skill_script("git-workflow", "commit_message.py")如需生成和验证提交信息,请使用。
get_skill_script("git-workflow", "commit_message.py")Format
格式
<type>(<scope>): <subject>
<body>
<footer><type>(<scope>): <subject>
<body>
<footer>Types
类型
- feat: New feature
- fix: Bug fix
- docs: Documentation only
- style: Formatting, no code change
- refactor: Code change that neither fixes a bug nor adds a feature
- perf: Performance improvement
- test: Adding or updating tests
- chore: Maintenance tasks
- feat:新功能
- fix:修复Bug
- docs:仅修改文档
- style:格式调整,无代码变更
- refactor:代码重构,既不是修复Bug也不是添加功能
- perf:性能优化
- test:添加或更新测试
- chore:维护任务
Examples
示例
feat(auth): add OAuth2 login support
Implemented OAuth2 authentication flow with Google and GitHub providers.
Added token refresh mechanism and session management.
Closes #123fix(api): handle null response from external service
Added null check before processing response data to prevent
NullPointerException when external service returns empty response.
Fixes #456feat(auth): add OAuth2 login support
Implemented OAuth2 authentication flow with Google and GitHub providers.
Added token refresh mechanism and session management.
Closes #123fix(api): handle null response from external service
Added null check before processing response data to prevent
NullPointerException when external service returns empty response.
Fixes #456Branch Naming
分支命名
Format
格式
<type>/<ticket-id>-<short-description><type>/<ticket-id>-<short-description>Examples
示例
feature/AUTH-123-oauth-loginfix/BUG-456-null-pointerchore/TECH-789-update-deps
feature/AUTH-123-oauth-loginfix/BUG-456-null-pointerchore/TECH-789-update-deps
Pull Request Guidelines
拉取请求指南
Title
标题
Follow commit message format for the title.
标题遵循提交信息格式。
Description Template
描述模板
markdown
undefinedmarkdown
undefinedSummary
Summary
Brief description of what this PR does.
Brief description of what this PR does.
Changes
Changes
- Change 1
- Change 2
- Change 1
- Change 2
Testing
Testing
How was this tested?
How was this tested?
Checklist
Checklist
- Tests added/updated
- Documentation updated
- No breaking changes
undefined- Tests added/updated
- Documentation updated
- No breaking changes
undefinedCommon Commands
常用命令
Starting Work
开始工作
bash
git checkout main
git pull origin main
git checkout -b feature/TICKET-123-descriptionbash
git checkout main
git pull origin main
git checkout -b feature/TICKET-123-descriptionCommitting
提交代码
bash
git add -p # Interactive staging
git commit -m "type(scope): description"bash
git add -p # Interactive staging
git commit -m "type(scope): description"Updating Branch
更新分支
bash
git fetch origin
git rebase origin/mainbash
git fetch origin
git rebase origin/mainCreating PR
创建拉取请求
bash
git push -u origin feature/TICKET-123-descriptionbash
git push -u origin feature/TICKET-123-descriptionThen create PR on GitHub/GitLab
Then create PR on GitHub/GitLab
undefinedundefined