git-helper

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Git 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-name
bash
git checkout -b feature/your-feature-name
git push -u origin feature/your-feature-name

Writing 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 origin
bash
git remote prune origin

Clean up local branches

清理本地分支

bash
git branch -d branch-name
bash
git branch -d branch-name

Scripts

脚本工具

This skill includes helper scripts:
create-branch.sh
- Creates new feature branches with proper naming •
commit-check.sh
- Validates commit message format •
cleanup.sh
- Removes stale branches
本工具包含以下辅助脚本:
create-branch.sh
- 按照规范命名创建新功能分支 •
commit-check.sh
- 验证提交消息格式 •
cleanup.sh
- 移除过时分支

Best Practices

最佳实践

  1. Always pull latest changes before creating branches
  2. Use descriptive branch names with prefixes (feature/, bugfix/, hotfix/)
  3. Write atomic commits (one logical change per commit)
  4. Keep commit messages under 72 characters for the subject line
  1. 创建分支前务必拉取最新代码
  2. 使用带前缀的描述性分支名称(feature/、bugfix/、hotfix/)
  3. 编写原子提交(每次提交对应一个逻辑变更)
  4. 提交消息主题行控制在72字符以内