git-helper
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGit Helper
Git 助手
A comprehensive skill for git workflow management and best practices.
一款用于Git工作流管理与最佳实践的全能工具。
Quick Start
快速开始
Use this skill when you need help with:
- Branch creation and management
- Commit message formatting
- Git workflow optimization
- Repository maintenance
当你需要以下帮助时,可使用本工具:
- 分支创建与管理
- 提交消息格式规范
- Git工作流优化
- 仓库维护
Common Workflows
常见工作流
Creating a New Feature Branch
创建新功能分支
bash
git checkout -b feature/your-feature-name
git push -u origin feature/your-feature-namebash
git checkout -b feature/your-feature-name
git push -u origin feature/your-feature-nameWriting Good Commit Messages
撰写优质提交消息
Follow the conventional commit format:
type(scope): description
[optional body]
[optional footer]Types: feat, fix, docs, style, refactor, test, chore
遵循约定式提交格式:
type(scope): description
[optional body]
[optional footer]类型包括:feat(新功能)、fix(修复)、docs(文档)、style(格式)、refactor(重构)、test(测试)、chore(杂项)
Git Cleanup Commands
Git清理命令
Remove stale branches
移除过时分支
bash
git remote prune originbash
git remote prune originClean up local branches
清理本地分支
bash
git branch -d branch-namebash
git branch -d branch-nameScripts
脚本工具
This skill includes helper scripts:
• - Creates new feature branches with proper naming
• - Validates commit message format
• - Removes stale branches
create-branch.shcommit-check.shcleanup.sh本工具包含以下辅助脚本:
• - 按照规范命名创建新功能分支
• - 验证提交消息格式
• - 移除过时分支
create-branch.shcommit-check.shcleanup.shBest Practices
最佳实践
- Always pull latest changes before creating branches
- Use descriptive branch names with prefixes (feature/, bugfix/, hotfix/)
- Write atomic commits (one logical change per commit)
- Keep commit messages under 72 characters for the subject line
- 创建分支前务必拉取最新代码
- 使用带前缀的描述性分支名称(feature/、bugfix/、hotfix/)
- 编写原子提交(每次提交对应一个逻辑变更)
- 提交消息主题行控制在72字符以内