git-auto
Git Workspace Automation — Streamline daily Git operations with intelligent defaults. Status checks, smart commits, safe pushes, and diff analysis in one skill.
When to Use
- - Check workspace status across multiple repos
- Generate meaningful commit messages from staged changes
- Push with safety checks (branch protection, conflict detection)
- View formatted logs and diffs
- Batch operations across monorepo subdirectories
Commands
status
# Show concise workspace status
git-auto status
# Multi-repo status scan
git-auto status --all
Returns: modified files, untracked files, branch info, ahead/behind count.
commit
# Auto-generate commit message from diff
git-auto commit
# With explicit message
git-auto commit -m "feat: add user auth"
# Commit specific files
git-auto commit -f "src/auth.ts,src/types.ts"
Behavior:
- 1. Runs
git diff --staged to analyze changes - Generates conventional commit message (feat/fix/refactor/docs/chore)
- Validates message format before committing
- Shows commit hash and summary
push
# Push current branch with safety checks
git-auto push
# Force push (with confirmation)
git-auto push --force
Safety checks:
- - Warns if pushing to main/master directly
- Checks for upstream conflicts
- Verifies remote exists
log
CODEBLOCK3
diff
CODEBLOCK4
Smart Commit Message Format
Uses Conventional Commits:
- -
feat: — New feature - INLINECODE2 — Bug fix
- INLINECODE3 — Code restructuring
- INLINECODE4 — Documentation only
- INLINECODE5 — Maintenance tasks
- INLINECODE6 — Adding/updating tests
Integration
Works with any Git repository. No configuration needed — auto-detects .git directory and current branch. Pairs well with code-review skill for pre-commit analysis.
Error Handling
| Situation | Behavior |
|---|
| Not a git repo | Clear error message with suggestion |
| Merge conflicts |
Shows conflict files, suggests resolution |
| No staged changes | Prompts to stage or shows unstaged changes |
| Auth failure | Suggests credential refresh |
| Detached HEAD | Warns and suggests creating branch |
git-auto
Git 工作区自动化 — 通过智能默认设置简化日常 Git 操作。一个技能即可完成状态检查、智能提交、安全推送和差异分析。
使用场景
- - 检查多个仓库的工作区状态
- 从暂存变更中生成有意义的提交信息
- 带安全检查的推送(分支保护、冲突检测)
- 查看格式化的日志和差异
- 对单体仓库子目录执行批量操作
命令
status
bash
显示简洁的工作区状态
git-auto status
多仓库状态扫描
git-auto status --all
返回:已修改文件、未跟踪文件、分支信息、领先/落后计数。
commit
bash
从差异自动生成提交信息
git-auto commit
使用显式信息
git-auto commit -m feat: 添加用户认证
提交特定文件
git-auto commit -f src/auth.ts,src/types.ts
行为:
- 1. 运行 git diff --staged 分析变更
- 生成约定式提交信息(feat/fix/refactor/docs/chore)
- 提交前验证信息格式
- 显示提交哈希和摘要
push
bash
带安全检查推送当前分支
git-auto push
强制推送(需确认)
git-auto push --force
安全检查:
- - 直接推送到 main/master 时发出警告
- 检查上游冲突
- 验证远程仓库是否存在
log
bash
最近10次提交,格式化显示
git-auto log
最近N次提交
git-auto log -n 20
按作者筛选
git-auto log --author name
diff
bash
暂存区变更
git-auto diff
工作目录变更
git-auto diff --unstaged
分支间差异
git-auto diff main..feature-branch
智能提交信息格式
采用约定式提交规范:
- - feat: — 新功能
- fix: — 错误修复
- refactor: — 代码重构
- docs: — 仅文档变更
- chore: — 维护任务
- test: — 添加/更新测试
集成
适用于任何 Git 仓库。无需配置 — 自动检测 .git 目录和当前分支。可与 code-review 技能配合使用,进行提交前分析。
错误处理
| 情况 | 行为 |
|---|
| 非 Git 仓库 | 显示清晰的错误信息及建议 |
| 合并冲突 |
显示冲突文件,建议解决方案 |
| 无暂存变更 | 提示暂存或显示未暂存变更 |
| 认证失败 | 建议刷新凭据 |
| 分离头指针 | 发出警告并建议创建分支 |