commit

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Commit

提交

Quick commit with conventional message format, then push.
按照规范的消息格式快速提交代码,然后推送。

Context

上下文信息

  • Git state: !
    git status
  • Staged changes: !
    git diff --cached --stat
  • Unstaged changes: !
    git diff --stat
  • Recent commits: !
    git log --oneline -5
  • Current branch: !
    git branch --show-current
  • Git状态: !
    git status
  • 已暂存变更: !
    git diff --cached --stat
  • 未暂存变更: !
    git diff --stat
  • 最近提交记录: !
    git log --oneline -5
  • 当前分支: !
    git branch --show-current

Workflow

工作流程

  1. Analyze: Review git status
    • Nothing staged but unstaged changes exist:
      git add .
    • Nothing to commit: inform user and exit
  2. Generate commit message:
    • Format:
      type(scope): brief description
    • Types:
      feat
      ,
      fix
      ,
      update
      ,
      docs
      ,
      chore
      ,
      refactor
      ,
      test
      ,
      perf
      ,
      revert
    • Under 72 chars, imperative mood, lowercase after colon
    • Example:
      update(statusline): refresh spend data
  3. Commit:
    git commit -m "message"
  4. Push:
    git push
  1. 分析: 查看Git状态
    • 无已暂存内容但存在未暂存变更时:
      git add .
    • 无内容可提交时:告知用户并退出
  2. 生成提交消息:
    • 格式:
      type(scope): brief description
    • 类型:
      feat
      ,
      fix
      ,
      update
      ,
      docs
      ,
      chore
      ,
      refactor
      ,
      test
      ,
      perf
      ,
      revert
    • 长度不超过72字符,使用祈使语气,冒号后首字母小写
    • 示例:
      update(statusline): refresh spend data
  3. 提交:
    git commit -m "message"
  4. 推送:
    git push

Rules

规则

  • SPEED OVER PERFECTION: Generate one good message and commit
  • NO INTERACTION: Never ask questions - analyze and commit
  • AUTO-STAGE: If nothing staged, stage everything
  • AUTO-PUSH: Always push after committing
  • IMPERATIVE MOOD: "add", "update", "fix" not past tense
  • 速度优先于完美:生成一条合适的消息并提交
  • 无需交互:绝不询问问题——直接分析并提交
  • 自动暂存:若无已暂存内容,暂存所有变更
  • 自动推送:提交后始终执行推送
  • 祈使语气:使用“add”“update”“fix”而非过去式